Lines Matching +full:pwr +full:- +full:reg

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
7 * Author: Marcin Niestroj <m.niestroj@grinn-global.com>
49 { .compatible = "ti,tps65217-pwrbutton", .data = &tps65217_data },
50 { .compatible = "ti,tps65218-pwrbutton", .data = &tps65218_data },
57 struct tps6521x_pwrbutton *pwr = _pwr; in tps6521x_pb_irq() local
58 const struct tps6521x_data *tps_data = pwr->data; in tps6521x_pb_irq()
59 unsigned int reg; in tps6521x_pb_irq() local
62 error = regmap_read(pwr->regmap, tps_data->reg_status, &reg); in tps6521x_pb_irq()
64 dev_err(pwr->dev, "can't read register: %d\n", error); in tps6521x_pb_irq()
68 if (reg & tps_data->pb_mask) { in tps6521x_pb_irq()
69 input_report_key(pwr->idev, KEY_POWER, 1); in tps6521x_pb_irq()
70 pm_wakeup_event(pwr->dev, 0); in tps6521x_pb_irq()
72 input_report_key(pwr->idev, KEY_POWER, 0); in tps6521x_pb_irq()
75 input_sync(pwr->idev); in tps6521x_pb_irq()
83 struct device *dev = &pdev->dev; in tps6521x_pb_probe()
84 struct tps6521x_pwrbutton *pwr; in tps6521x_pb_probe() local
90 match = of_match_node(of_tps6521x_pb_match, dev->of_node); in tps6521x_pb_probe()
92 return -ENXIO; in tps6521x_pb_probe()
94 pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL); in tps6521x_pb_probe()
95 if (!pwr) in tps6521x_pb_probe()
96 return -ENOMEM; in tps6521x_pb_probe()
98 pwr->data = match->data; in tps6521x_pb_probe()
102 return -ENOMEM; in tps6521x_pb_probe()
104 idev->name = pwr->data->name; in tps6521x_pb_probe()
105 snprintf(pwr->phys, sizeof(pwr->phys), "%s/input0", in tps6521x_pb_probe()
106 pwr->data->name); in tps6521x_pb_probe()
107 idev->phys = pwr->phys; in tps6521x_pb_probe()
108 idev->dev.parent = dev; in tps6521x_pb_probe()
109 idev->id.bustype = BUS_I2C; in tps6521x_pb_probe()
113 pwr->regmap = dev_get_regmap(dev->parent, NULL); in tps6521x_pb_probe()
114 pwr->dev = dev; in tps6521x_pb_probe()
115 pwr->idev = idev; in tps6521x_pb_probe()
120 return -EINVAL; in tps6521x_pb_probe()
126 pwr->data->name, pwr); in tps6521x_pb_probe()
142 { "tps65218-pwrbutton", },
143 { "tps65217-pwrbutton", },