diff options
| author | Antonio Ospite <ospite@studenti.unina.it> | 2011-04-13 15:40:45 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2011-04-19 15:38:02 -0400 |
| commit | cbc6a6ed0900aed789b5ca77192845f2f987af70 (patch) | |
| tree | d7aa6e267e34417a857121de210ffd47f8e0eb2a /include/linux | |
| parent | bb411b4db2767cfd4a99b3328da843ce4ea1596a (diff) | |
rfkill: Regulator consumer driver for rfkill
Add a regulator consumer driver for rfkill to enable controlling radio
transmitters connected to voltage regulators using the regulator
framework.
A new "vrfkill" virtual supply is provided to use in platform code.
Signed-off-by: Guiming Zhuo <gmzhuo@gmail.com>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/rfkill-regulator.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/linux/rfkill-regulator.h b/include/linux/rfkill-regulator.h new file mode 100644 index 000000000000..aca36bc83315 --- /dev/null +++ b/include/linux/rfkill-regulator.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | * rfkill-regulator.c - Regulator consumer driver for rfkill | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Guiming Zhuo <gmzhuo@gmail.com> | ||
| 5 | * Copyright (C) 2011 Antonio Ospite <ospite@studenti.unina.it> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_RFKILL_REGULATOR_H | ||
| 14 | #define __LINUX_RFKILL_REGULATOR_H | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Use "vrfkill" as supply id when declaring the regulator consumer: | ||
| 18 | * | ||
| 19 | * static struct regulator_consumer_supply pcap_regulator_V6_consumers [] = { | ||
| 20 | * { .dev_name = "rfkill-regulator.0", .supply = "vrfkill" }, | ||
| 21 | * }; | ||
| 22 | * | ||
| 23 | * If you have several regulator driven rfkill, you can append a numerical id to | ||
| 24 | * .dev_name as done above, and use the same id when declaring the platform | ||
| 25 | * device: | ||
| 26 | * | ||
| 27 | * static struct rfkill_regulator_platform_data ezx_rfkill_bt_data = { | ||
| 28 | * .name = "ezx-bluetooth", | ||
| 29 | * .type = RFKILL_TYPE_BLUETOOTH, | ||
| 30 | * }; | ||
| 31 | * | ||
| 32 | * static struct platform_device a910_rfkill = { | ||
| 33 | * .name = "rfkill-regulator", | ||
| 34 | * .id = 0, | ||
| 35 | * .dev = { | ||
| 36 | * .platform_data = &ezx_rfkill_bt_data, | ||
| 37 | * }, | ||
| 38 | * }; | ||
| 39 | */ | ||
| 40 | |||
| 41 | #include <linux/rfkill.h> | ||
| 42 | |||
| 43 | struct rfkill_regulator_platform_data { | ||
| 44 | char *name; /* the name for the rfkill switch */ | ||
| 45 | enum rfkill_type type; /* the type as specified in rfkill.h */ | ||
| 46 | }; | ||
| 47 | |||
| 48 | #endif /* __LINUX_RFKILL_REGULATOR_H */ | ||
