Lines Matching full:rfkill

11 #include <linux/rfkill.h>
25 struct rfkill *rfkill_dev;
33 struct rfkill_gpio_data *rfkill = data; in rfkill_gpio_set_power() local
35 if (!blocked && !IS_ERR(rfkill->clk) && !rfkill->clk_enabled) in rfkill_gpio_set_power()
36 clk_enable(rfkill->clk); in rfkill_gpio_set_power()
38 gpiod_set_value_cansleep(rfkill->shutdown_gpio, !blocked); in rfkill_gpio_set_power()
39 gpiod_set_value_cansleep(rfkill->reset_gpio, !blocked); in rfkill_gpio_set_power()
41 if (blocked && !IS_ERR(rfkill->clk) && rfkill->clk_enabled) in rfkill_gpio_set_power()
42 clk_disable(rfkill->clk); in rfkill_gpio_set_power()
44 rfkill->clk_enabled = !blocked; in rfkill_gpio_set_power()
63 struct rfkill_gpio_data *rfkill) in rfkill_gpio_acpi_probe() argument
71 rfkill->type = (unsigned)id->driver_data; in rfkill_gpio_acpi_probe()
76 /* List of DMI matches for devices on which rfkill-gpio should not load,
92 struct rfkill_gpio_data *rfkill; in rfkill_gpio_probe() local
102 rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); in rfkill_gpio_probe()
103 if (!rfkill) in rfkill_gpio_probe()
113 device_property_read_string(&pdev->dev, name_property, &rfkill->name); in rfkill_gpio_probe()
116 if (!rfkill->name) in rfkill_gpio_probe()
117 rfkill->name = dev_name(&pdev->dev); in rfkill_gpio_probe()
119 rfkill->type = rfkill_find_type(type_name); in rfkill_gpio_probe()
122 ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill); in rfkill_gpio_probe()
127 rfkill->clk = devm_clk_get(&pdev->dev, NULL); in rfkill_gpio_probe()
133 rfkill->reset_gpio = gpio; in rfkill_gpio_probe()
139 rfkill->shutdown_gpio = gpio; in rfkill_gpio_probe()
142 if (!rfkill->reset_gpio && !rfkill->shutdown_gpio) { in rfkill_gpio_probe()
147 ret = gpiod_direction_output(rfkill->reset_gpio, true); in rfkill_gpio_probe()
151 ret = gpiod_direction_output(rfkill->shutdown_gpio, true); in rfkill_gpio_probe()
155 rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev, in rfkill_gpio_probe()
156 rfkill->type, &rfkill_gpio_ops, in rfkill_gpio_probe()
157 rfkill); in rfkill_gpio_probe()
158 if (!rfkill->rfkill_dev) in rfkill_gpio_probe()
161 ret = rfkill_register(rfkill->rfkill_dev); in rfkill_gpio_probe()
165 platform_set_drvdata(pdev, rfkill); in rfkill_gpio_probe()
167 dev_info(&pdev->dev, "%s device registered.\n", rfkill->name); in rfkill_gpio_probe()
172 rfkill_destroy(rfkill->rfkill_dev); in rfkill_gpio_probe()
179 struct rfkill_gpio_data *rfkill = platform_get_drvdata(pdev); in rfkill_gpio_remove() local
181 rfkill_unregister(rfkill->rfkill_dev); in rfkill_gpio_remove()
182 rfkill_destroy(rfkill->rfkill_dev); in rfkill_gpio_remove()
195 { .compatible = "rfkill-gpio", },
212 MODULE_DESCRIPTION("gpio rfkill");