Lines Matching +full:sel +full:- +full:gpios
1 // SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
6 * Platform support for the b2093 mainboard used in SEL-3350 computers.
35 { .name = "sel:green:aux1" },
36 { .name = "sel:green:aux2" },
37 { .name = "sel:green:aux3" },
38 { .name = "sel:green:aux4" },
39 { .name = "sel:red:alarm" },
40 { .name = "sel:green:enabled",
42 { .name = "sel:red:aux1" },
43 { .name = "sel:red:aux2" },
44 { .name = "sel:red:aux3" },
45 { .name = "sel:red:aux4" },
53 /* Map GPIOs to LEDs */
55 .dev_id = "leds-gpio",
71 /* Map GPIOs to power supplies */
98 if (gpiod_get_value(data->ps_detect)) { in sel3350_power_get_property()
99 if (gpiod_get_value(data->ps_good)) in sel3350_power_get_property()
100 val->intval = POWER_SUPPLY_HEALTH_GOOD; in sel3350_power_get_property()
102 val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; in sel3350_power_get_property()
104 val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; in sel3350_power_get_property()
108 val->intval = gpiod_get_value(data->ps_detect); in sel3350_power_get_property()
111 val->intval = gpiod_get_value(data->ps_good); in sel3350_power_get_property()
114 return -EINVAL; in sel3350_power_get_property()
155 sel3350 = devm_kzalloc(&pdev->dev, sizeof(struct sel3350_data), GFP_KERNEL); in sel3350_probe()
157 return -ENOMEM; in sel3350_probe()
164 sel3350->leds_pdev = platform_device_register_data( in sel3350_probe()
166 "leds-gpio", in sel3350_probe()
170 if (IS_ERR(sel3350->leds_pdev)) { in sel3350_probe()
171 rs = PTR_ERR(sel3350->leds_pdev); in sel3350_probe()
172 dev_err(&pdev->dev, "Failed registering platform device: %d\n", rs); in sel3350_probe()
177 sel3350->ps_a_cfg_data.ps_detect = devm_gpiod_get(&pdev->dev, in sel3350_probe()
180 sel3350->ps_a_cfg_data.ps_good = devm_gpiod_get(&pdev->dev, in sel3350_probe()
183 ps_cfg.drv_data = &sel3350->ps_a_cfg_data; in sel3350_probe()
184 sel3350->ps_a = devm_power_supply_register(&pdev->dev, in sel3350_probe()
187 if (IS_ERR(sel3350->ps_a)) { in sel3350_probe()
188 rs = PTR_ERR(sel3350->ps_a); in sel3350_probe()
189 dev_err(&pdev->dev, "Failed registering power supply A: %d\n", rs); in sel3350_probe()
194 sel3350->ps_b_cfg_data.ps_detect = devm_gpiod_get(&pdev->dev, in sel3350_probe()
197 sel3350->ps_b_cfg_data.ps_good = devm_gpiod_get(&pdev->dev, in sel3350_probe()
200 ps_cfg.drv_data = &sel3350->ps_b_cfg_data; in sel3350_probe()
201 sel3350->ps_b = devm_power_supply_register(&pdev->dev, in sel3350_probe()
204 if (IS_ERR(sel3350->ps_b)) { in sel3350_probe()
205 rs = PTR_ERR(sel3350->ps_b); in sel3350_probe()
206 dev_err(&pdev->dev, "Failed registering power supply B: %d\n", rs); in sel3350_probe()
213 platform_device_unregister(sel3350->leds_pdev); in sel3350_probe()
225 platform_device_unregister(sel3350->leds_pdev); in sel3350_remove()
240 .name = "sel3350-platform",
247 MODULE_DESCRIPTION("SEL-3350 platform driver");
249 MODULE_SOFTDEP("pre: pinctrl_broxton leds-gpio");