• Home
  • Raw
  • Download

Lines Matching +full:long +full:- +full:press +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-or-later
8 // https://www.rohm.com/datasheet/BD71837MWV/bd71837mwv-e
14 #include <linux/mfd/rohm-bd718x7.h>
23 .gpio = -1,
30 .name = "bd718xx-pwrkey",
35 .name = "gpio-keys",
39 { .name = "bd71837-clk", },
40 { .name = "bd71837-pmic", },
45 .name = "gpio-keys",
49 { .name = "bd71847-clk", },
50 { .name = "bd71847-pmic", },
64 .name = "bd718xx-irq",
90 .max_register = BD718XX_MAX_REGISTER - 1,
96 struct device* dev = bd718xx->chip.dev; in bd718xx_init_press_duration()
101 ret = of_property_read_u32(dev->of_node, "rohm,short-press-ms", in bd718xx_init_press_duration()
105 ret = regmap_update_bits(bd718xx->chip.regmap, in bd718xx_init_press_duration()
110 dev_err(dev, "Failed to init pwron short press\n"); in bd718xx_init_press_duration()
115 ret = of_property_read_u32(dev->of_node, "rohm,long-press-ms", in bd718xx_init_press_duration()
119 ret = regmap_update_bits(bd718xx->chip.regmap, in bd718xx_init_press_duration()
124 dev_err(dev, "Failed to init pwron long press\n"); in bd718xx_init_press_duration()
141 if (!i2c->irq) { in bd718xx_i2c_probe()
142 dev_err(&i2c->dev, "No IRQ configured\n"); in bd718xx_i2c_probe()
143 return -EINVAL; in bd718xx_i2c_probe()
146 bd718xx = devm_kzalloc(&i2c->dev, sizeof(struct bd718xx), GFP_KERNEL); in bd718xx_i2c_probe()
149 return -ENOMEM; in bd718xx_i2c_probe()
151 bd718xx->chip_irq = i2c->irq; in bd718xx_i2c_probe()
153 of_device_get_match_data(&i2c->dev); in bd718xx_i2c_probe()
164 dev_err(&i2c->dev, "Unknown device type"); in bd718xx_i2c_probe()
165 return -EINVAL; in bd718xx_i2c_probe()
167 bd718xx->chip.dev = &i2c->dev; in bd718xx_i2c_probe()
168 dev_set_drvdata(&i2c->dev, bd718xx); in bd718xx_i2c_probe()
170 bd718xx->chip.regmap = devm_regmap_init_i2c(i2c, in bd718xx_i2c_probe()
172 if (IS_ERR(bd718xx->chip.regmap)) { in bd718xx_i2c_probe()
173 dev_err(&i2c->dev, "regmap initialization failed\n"); in bd718xx_i2c_probe()
174 return PTR_ERR(bd718xx->chip.regmap); in bd718xx_i2c_probe()
177 ret = devm_regmap_add_irq_chip(&i2c->dev, bd718xx->chip.regmap, in bd718xx_i2c_probe()
178 bd718xx->chip_irq, IRQF_ONESHOT, 0, in bd718xx_i2c_probe()
179 &bd718xx_irq_chip, &bd718xx->irq_data); in bd718xx_i2c_probe()
181 dev_err(&i2c->dev, "Failed to add irq_chip\n"); in bd718xx_i2c_probe()
189 ret = regmap_irq_get_virq(bd718xx->irq_data, BD718XX_INT_PWRBTN_S); in bd718xx_i2c_probe()
192 dev_err(&i2c->dev, "Failed to get the IRQ\n"); in bd718xx_i2c_probe()
198 ret = devm_mfd_add_devices(bd718xx->chip.dev, PLATFORM_DEVID_AUTO, in bd718xx_i2c_probe()
200 regmap_irq_get_domain(bd718xx->irq_data)); in bd718xx_i2c_probe()
202 dev_err(&i2c->dev, "Failed to create subdevices\n"); in bd718xx_i2c_probe()
226 .name = "rohm-bd718x7",