Lines Matching full:rfkill
10 #include <linux/rfkill.h>
24 struct rfkill *rfkill_dev;
32 struct rfkill_gpio_data *rfkill = data; in rfkill_gpio_set_power() local
34 if (!blocked && !IS_ERR(rfkill->clk) && !rfkill->clk_enabled) { in rfkill_gpio_set_power()
35 int ret = clk_enable(rfkill->clk); in rfkill_gpio_set_power()
41 gpiod_set_value_cansleep(rfkill->shutdown_gpio, !blocked); in rfkill_gpio_set_power()
42 gpiod_set_value_cansleep(rfkill->reset_gpio, !blocked); in rfkill_gpio_set_power()
44 if (blocked && !IS_ERR(rfkill->clk) && rfkill->clk_enabled) in rfkill_gpio_set_power()
45 clk_disable(rfkill->clk); in rfkill_gpio_set_power()
47 rfkill->clk_enabled = !blocked; in rfkill_gpio_set_power()
66 struct rfkill_gpio_data *rfkill) in rfkill_gpio_acpi_probe() argument
74 rfkill->type = (unsigned)id->driver_data; in rfkill_gpio_acpi_probe()
81 struct rfkill_gpio_data *rfkill; in rfkill_gpio_probe() local
88 rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); in rfkill_gpio_probe()
89 if (!rfkill) in rfkill_gpio_probe()
99 device_property_read_string(&pdev->dev, name_property, &rfkill->name); in rfkill_gpio_probe()
102 if (!rfkill->name) in rfkill_gpio_probe()
103 rfkill->name = dev_name(&pdev->dev); in rfkill_gpio_probe()
105 rfkill->type = rfkill_find_type(type_name); in rfkill_gpio_probe()
108 ret = rfkill_gpio_acpi_probe(&pdev->dev, rfkill); in rfkill_gpio_probe()
113 rfkill->clk = devm_clk_get(&pdev->dev, NULL); in rfkill_gpio_probe()
119 rfkill->reset_gpio = gpio; in rfkill_gpio_probe()
125 rfkill->shutdown_gpio = gpio; in rfkill_gpio_probe()
128 if (!rfkill->reset_gpio && !rfkill->shutdown_gpio) { in rfkill_gpio_probe()
133 ret = gpiod_direction_output(rfkill->reset_gpio, true); in rfkill_gpio_probe()
137 ret = gpiod_direction_output(rfkill->shutdown_gpio, true); in rfkill_gpio_probe()
141 rfkill->rfkill_dev = rfkill_alloc(rfkill->name, &pdev->dev, in rfkill_gpio_probe()
142 rfkill->type, &rfkill_gpio_ops, in rfkill_gpio_probe()
143 rfkill); in rfkill_gpio_probe()
144 if (!rfkill->rfkill_dev) in rfkill_gpio_probe()
147 ret = rfkill_register(rfkill->rfkill_dev); in rfkill_gpio_probe()
151 platform_set_drvdata(pdev, rfkill); in rfkill_gpio_probe()
153 dev_info(&pdev->dev, "%s device registered.\n", rfkill->name); in rfkill_gpio_probe()
158 rfkill_destroy(rfkill->rfkill_dev); in rfkill_gpio_probe()
165 struct rfkill_gpio_data *rfkill = platform_get_drvdata(pdev); in rfkill_gpio_remove() local
167 rfkill_unregister(rfkill->rfkill_dev); in rfkill_gpio_remove()
168 rfkill_destroy(rfkill->rfkill_dev); in rfkill_gpio_remove()
183 { .compatible = "rfkill-gpio", },
200 MODULE_DESCRIPTION("gpio rfkill");