Lines Matching +full:pwr +full:- +full:reg
4 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
6 * Author: Marcin Niestroj <m.niestroj@grinn-global.com>
57 { .compatible = "ti,tps65217-pwrbutton", .data = &tps65217_data },
58 { .compatible = "ti,tps65218-pwrbutton", .data = &tps65218_data },
65 struct tps6521x_pwrbutton *pwr = _pwr; in tps6521x_pb_irq() local
66 const struct tps6521x_data *tps_data = pwr->data; in tps6521x_pb_irq()
67 unsigned int reg; in tps6521x_pb_irq() local
70 error = regmap_read(pwr->regmap, tps_data->reg_status, ®); in tps6521x_pb_irq()
72 dev_err(pwr->dev, "can't read register: %d\n", error); in tps6521x_pb_irq()
76 if (reg & tps_data->pb_mask) { in tps6521x_pb_irq()
77 input_report_key(pwr->idev, KEY_POWER, 1); in tps6521x_pb_irq()
78 pm_wakeup_event(pwr->dev, 0); in tps6521x_pb_irq()
80 input_report_key(pwr->idev, KEY_POWER, 0); in tps6521x_pb_irq()
83 input_sync(pwr->idev); in tps6521x_pb_irq()
91 struct device *dev = &pdev->dev; in tps6521x_pb_probe()
92 struct tps6521x_pwrbutton *pwr; in tps6521x_pb_probe() local
98 match = of_match_node(of_tps6521x_pb_match, dev->of_node); in tps6521x_pb_probe()
100 return -ENXIO; in tps6521x_pb_probe()
102 pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL); in tps6521x_pb_probe()
103 if (!pwr) in tps6521x_pb_probe()
104 return -ENOMEM; in tps6521x_pb_probe()
106 pwr->data = match->data; in tps6521x_pb_probe()
110 return -ENOMEM; in tps6521x_pb_probe()
112 idev->name = pwr->data->name; in tps6521x_pb_probe()
113 snprintf(pwr->phys, sizeof(pwr->phys), "%s/input0", in tps6521x_pb_probe()
114 pwr->data->name); in tps6521x_pb_probe()
115 idev->phys = pwr->phys; in tps6521x_pb_probe()
116 idev->dev.parent = dev; in tps6521x_pb_probe()
117 idev->id.bustype = BUS_I2C; in tps6521x_pb_probe()
121 pwr->regmap = dev_get_regmap(dev->parent, NULL); in tps6521x_pb_probe()
122 pwr->dev = dev; in tps6521x_pb_probe()
123 pwr->idev = idev; in tps6521x_pb_probe()
128 return -EINVAL; in tps6521x_pb_probe()
134 pwr->data->name, pwr); in tps6521x_pb_probe()
150 { "tps65218-pwrbutton", },
151 { "tps65217-pwrbutton", },