summaryrefslogtreecommitdiff
path: root/include/linux/rfkill-regulator.h
blob: aca36bc83315814ea73279dc7261e03492895a1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
 * rfkill-regulator.c - Regulator consumer driver for rfkill
 *
 * Copyright (C) 2009  Guiming Zhuo <gmzhuo@gmail.com>
 * Copyright (C) 2011  Antonio Ospite <ospite@studenti.unina.it>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

#ifndef __LINUX_RFKILL_REGULATOR_H
#define __LINUX_RFKILL_REGULATOR_H

/*
 * Use "vrfkill" as supply id when declaring the regulator consumer:
 *
 * static struct regulator_consumer_supply pcap_regulator_V6_consumers [] = {
 * 	{ .dev_name = "rfkill-regulator.0", .supply = "vrfkill" },
 * };
 *
 * If you have several regulator driven rfkill, you can append a numerical id to
 * .dev_name as done above, and use the same id when declaring the platform
 * device:
 *
 * static struct rfkill_regulator_platform_data ezx_rfkill_bt_data = {
 * 	.name  = "ezx-bluetooth",
 * 	.type  = RFKILL_TYPE_BLUETOOTH,
 * };
 *
 * static struct platform_device a910_rfkill = {
 * 	.name  = "rfkill-regulator",
 * 	.id    = 0,
 * 	.dev   = {
 * 		.platform_data = &ezx_rfkill_bt_data,
 * 	},
 * };
 */

#include <linux/rfkill.h>

struct rfkill_regulator_platform_data {
	char *name;             /* the name for the rfkill switch */
	enum rfkill_type type;  /* the type as specified in rfkill.h */
};

#endif /* __LINUX_RFKILL_REGULATOR_H */
access to RAM via /dev/mem") Fixes: 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()") Signed-off-by: Liang Wang <wangliang101@huawei.com> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Cc: Palmer Dabbelt <palmerdabbelt@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Russell King <linux@armlinux.org.uk> Cc: Liang Wang <wangliang101@huawei.com> Cc: Xiaoming Ni <nixiaoming@huawei.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: <stable@vger.kernel.org> [2.6.37+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> 2020-12-11lib: Add a generic version of devmem_is_allowed()Palmer Dabbelt As part of adding support for STRICT_DEVMEM to the RISC-V port, Zong provided a devmem_is_allowed() implementation that's exactly the same as all the others I checked. Instead I'm adding a generic version, which will soon be used. Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>