Lines Matching +full:on +full:- +full:the +full:- +full:go

1 // SPDX-License-Identifier: GPL-2.0+
16 * The Odroid Go Ultra has 2 PMICs:
17 * - RK818 (manages the battery and USB-C power supply)
18 * - RK817
19 * Both PMICs feeds power to the S922X SoC, so they must be powered-off in sequence.
20 * Vendor does power-off the RK817 first, then the RK818 so here we follow this sequence.
31 struct odroid_go_ultra_poweroff_data *poweroff_data = data->cb_data; in odroid_go_ultra_poweroff_prepare()
36 rk817 = dev_get_regmap(poweroff_data->rk817, NULL); in odroid_go_ultra_poweroff_prepare()
38 dev_err(poweroff_data->dev, "failed to get rk817 regmap\n"); in odroid_go_ultra_poweroff_prepare()
39 return notifier_from_errno(-EINVAL); in odroid_go_ultra_poweroff_prepare()
43 rk818 = dev_get_regmap(poweroff_data->rk818, NULL); in odroid_go_ultra_poweroff_prepare()
45 dev_err(poweroff_data->dev, "failed to get rk818 regmap\n"); in odroid_go_ultra_poweroff_prepare()
46 return notifier_from_errno(-EINVAL); in odroid_go_ultra_poweroff_prepare()
49 dev_info(poweroff_data->dev, "Setting PMICs for power off"); in odroid_go_ultra_poweroff_prepare()
54 dev_err(poweroff_data->dev, "failed to poweroff rk817\n"); in odroid_go_ultra_poweroff_prepare()
61 dev_err(poweroff_data->dev, "failed to poweroff rk818\n"); in odroid_go_ultra_poweroff_prepare()
83 return -ENODEV; in odroid_go_ultra_poweroff_get_pmic_device()
88 return -EPROBE_DEFER; in odroid_go_ultra_poweroff_get_pmic_device()
90 *pmic = &pmic_client->dev; in odroid_go_ultra_poweroff_get_pmic_device()
100 poweroff_data = devm_kzalloc(&pdev->dev, sizeof(*poweroff_data), GFP_KERNEL); in odroid_go_ultra_poweroff_probe()
102 return -ENOMEM; in odroid_go_ultra_poweroff_probe()
104 dev_set_drvdata(&pdev->dev, poweroff_data); in odroid_go_ultra_poweroff_probe()
107 ret = odroid_go_ultra_poweroff_get_pmic_device(&pdev->dev, "rockchip,rk818", in odroid_go_ultra_poweroff_probe()
108 &poweroff_data->rk818); in odroid_go_ultra_poweroff_probe()
110 return dev_err_probe(&pdev->dev, ret, "failed to get rk818 mfd data\n"); in odroid_go_ultra_poweroff_probe()
113 ret = odroid_go_ultra_poweroff_get_pmic_device(&pdev->dev, "rockchip,rk817", in odroid_go_ultra_poweroff_probe()
114 &poweroff_data->rk817); in odroid_go_ultra_poweroff_probe()
116 return dev_err_probe(&pdev->dev, ret, "failed to get rk817 mfd data\n"); in odroid_go_ultra_poweroff_probe()
119 ret = devm_register_sys_off_handler(&pdev->dev, in odroid_go_ultra_poweroff_probe()
125 return dev_err_probe(&pdev->dev, ret, "failed to register sys-off handler\n"); in odroid_go_ultra_poweroff_probe()
127 dev_info(&pdev->dev, "Registered Power-Off handler\n"); in odroid_go_ultra_poweroff_probe()
135 .name = "odroid-go-ultra-poweroff",
144 /* Only create when running on the Odroid Go Ultra device */ in odroid_go_ultra_poweroff_init()
145 if (!of_device_is_compatible(of_root, "hardkernel,odroid-go-ultra")) in odroid_go_ultra_poweroff_init()
146 return -ENODEV; in odroid_go_ultra_poweroff_init()
152 pdev = platform_device_register_resndata(NULL, "odroid-go-ultra-poweroff", -1, in odroid_go_ultra_poweroff_init()
165 /* Only delete when running on the Odroid Go Ultra device */ in odroid_go_ultra_poweroff_exit()
166 if (!of_device_is_compatible(of_root, "hardkernel,odroid-go-ultra")) in odroid_go_ultra_poweroff_exit()
177 MODULE_DESCRIPTION("Odroid Go Ultra poweroff driver");