Lines Matching +full:pull +full:- +full:ups
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
71 * struct pmic8xxx_pwrkey - pmic8xxx pwrkey information
107 enable_irq_wake(pwrkey->key_press_irq); in pmic8xxx_pwrkey_suspend()
117 disable_irq_wake(pwrkey->key_press_irq); in pmic8xxx_pwrkey_resume()
132 if (pwrkey->shutdown_fn) { in pmic8xxx_pwrkey_shutdown()
133 error = pwrkey->shutdown_fn(pwrkey, reset); in pmic8xxx_pwrkey_shutdown()
140 * Also ensure that KPD, CBL0, and CBL1 pull ups are enabled and that in pmic8xxx_pwrkey_shutdown()
149 regmap_update_bits(pwrkey->regmap, PON_CNTL_1, mask, val); in pmic8xxx_pwrkey_shutdown()
154 * in the master enable register. Also set it's pull down enable bit.
200 return -EPERM; in pm8058_disable_smps_locally_set_pull_down()
238 /* Enable locally, enable pull down, keep voltage the same. */ in pm8058_disable_smps_locally_set_pull_down()
256 /* Disable locally and enable pull down. */ in pm8058_disable_smps_locally_set_pull_down()
273 /* Disable LDO in CTRL register and set pull down */ in pm8058_disable_ldo_locally_set_pull_down()
282 struct regmap *regmap = pwrkey->regmap; in pm8058_pwrkey_shutdown()
304 * Fix-up: Set regulator LDO22 to 1.225 V in high power mode. Leave its in pm8058_pwrkey_shutdown()
305 * pull-down state intact. This ensures a safe shutdown. in pm8058_pwrkey_shutdown()
321 struct regmap *regmap = pwrkey->regmap; in pm8921_pwrkey_shutdown()
344 if (of_property_read_u32(pdev->dev.of_node, "debounce", &kpd_delay)) in pmic8xxx_pwrkey_probe()
349 dev_err(&pdev->dev, "invalid power key trigger delay\n"); in pmic8xxx_pwrkey_probe()
350 return -EINVAL; in pmic8xxx_pwrkey_probe()
353 pull_up = of_property_read_bool(pdev->dev.of_node, "pull-up"); in pmic8xxx_pwrkey_probe()
355 regmap = dev_get_regmap(pdev->dev.parent, NULL); in pmic8xxx_pwrkey_probe()
357 dev_err(&pdev->dev, "failed to locate regmap for the device\n"); in pmic8xxx_pwrkey_probe()
358 return -ENODEV; in pmic8xxx_pwrkey_probe()
361 pwrkey = devm_kzalloc(&pdev->dev, sizeof(*pwrkey), GFP_KERNEL); in pmic8xxx_pwrkey_probe()
363 return -ENOMEM; in pmic8xxx_pwrkey_probe()
365 pwrkey->shutdown_fn = of_device_get_match_data(&pdev->dev); in pmic8xxx_pwrkey_probe()
366 pwrkey->regmap = regmap; in pmic8xxx_pwrkey_probe()
367 pwrkey->key_press_irq = key_press_irq; in pmic8xxx_pwrkey_probe()
369 pwr = devm_input_allocate_device(&pdev->dev); in pmic8xxx_pwrkey_probe()
371 dev_dbg(&pdev->dev, "Can't allocate power button\n"); in pmic8xxx_pwrkey_probe()
372 return -ENOMEM; in pmic8xxx_pwrkey_probe()
377 pwr->name = "pmic8xxx_pwrkey"; in pmic8xxx_pwrkey_probe()
378 pwr->phys = "pmic8xxx_pwrkey/input0"; in pmic8xxx_pwrkey_probe()
385 dev_err(&pdev->dev, "failed reading PON_CNTL_1 err=%d\n", err); in pmic8xxx_pwrkey_probe()
398 dev_err(&pdev->dev, "failed writing PON_CNTL_1 err=%d\n", err); in pmic8xxx_pwrkey_probe()
402 err = devm_request_irq(&pdev->dev, key_press_irq, pwrkey_press_irq, in pmic8xxx_pwrkey_probe()
406 dev_err(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n", in pmic8xxx_pwrkey_probe()
411 err = devm_request_irq(&pdev->dev, key_release_irq, pwrkey_release_irq, in pmic8xxx_pwrkey_probe()
415 dev_err(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n", in pmic8xxx_pwrkey_probe()
422 dev_err(&pdev->dev, "Can't register power key: %d\n", err); in pmic8xxx_pwrkey_probe()
427 device_init_wakeup(&pdev->dev, 1); in pmic8xxx_pwrkey_probe()
433 { .compatible = "qcom,pm8058-pwrkey", .data = &pm8058_pwrkey_shutdown },
434 { .compatible = "qcom,pm8921-pwrkey", .data = &pm8921_pwrkey_shutdown },
443 .name = "pm8xxx-pwrkey",