15 #include <linux/module.h>
17 #include <linux/slab.h>
20 #include <linux/rfkill.h>
30 static int rfkill_regulator_set_block(
void *
data,
bool blocked)
34 pr_debug(
"%s: blocked: %d\n", __func__, blocked);
48 pr_debug(
"%s: regulator_is_enabled after set_block: %d\n", __func__,
55 .set_block = rfkill_regulator_set_block,
72 dev_err(&pdev->
dev,
"invalid name or type in platform data\n");
83 rfkill_data = kzalloc(
sizeof(*rfkill_data),
GFP_KERNEL);
84 if (rfkill_data ==
NULL) {
91 &rfkill_regulator_ops, rfkill_data);
92 if (rf_kill ==
NULL) {
94 goto err_rfkill_alloc;
98 dev_dbg(&pdev->
dev,
"Regulator already enabled\n");
102 rfkill_data->
rf_kill = rf_kill;
106 dev_err(&pdev->
dev,
"Cannot register rfkill device\n");
107 goto err_rfkill_register;
110 platform_set_drvdata(pdev, rfkill_data);
139 .probe = rfkill_regulator_probe,
142 .name =
"rfkill-regulator",