Lines Matching +full:push +full:- +full:button

1 // SPDX-License-Identifier: GPL-2.0
3 * The Gateworks System Controller (GSC) is a multi-function
6 * system functions such as push-button monitoring, multiple ADC's for
40 * -EAGAIN returned when the i2c host controller is busy in gsc_write()
41 * -EIO returned when i2c device is busy in gsc_write()
43 if (ret != -EAGAIN && ret != -EIO) in gsc_write()
59 * -EAGAIN returned when the i2c host controller is busy in gsc_read()
60 * -EIO returned when i2c device is busy in gsc_read()
62 if (ret != -EAGAIN && ret != -EIO) in gsc_read()
72 * gsc_powerdown - API to use GSC to power down board for a specific time
74 * secs - number of seconds to remain powered off
81 dev_info(&gsc->i2c->dev, "GSC powerdown for %ld seconds\n", in gsc_powerdown()
85 ret = regmap_bulk_write(gsc->regmap, GSC_TIME_ADD, regs, 4); in gsc_powerdown()
89 ret = regmap_update_bits(gsc->regmap, GSC_CTRL_1, in gsc_powerdown()
95 ret = regmap_update_bits(gsc->regmap, GSC_CTRL_1, in gsc_powerdown()
109 const char *name = attr->attr.name; in gsc_show()
113 rz = sprintf(buf, "%d\n", gsc->fwver); in gsc_show()
115 rz = sprintf(buf, "0x%04x\n", gsc->fwcrc); in gsc_show()
126 const char *name = attr->attr.name; in gsc_store()
187 .name = "gateworks-gsc",
200 struct device *dev = &client->dev; in gsc_probe()
208 return -ENOMEM; in gsc_probe()
210 gsc->dev = &client->dev; in gsc_probe()
211 gsc->i2c = client; in gsc_probe()
214 gsc->regmap = devm_regmap_init(dev, &gsc_regmap_bus, client, in gsc_probe()
216 if (IS_ERR(gsc->regmap)) in gsc_probe()
217 return PTR_ERR(gsc->regmap); in gsc_probe()
219 if (regmap_read(gsc->regmap, GSC_FW_VER, &reg)) in gsc_probe()
220 return -EIO; in gsc_probe()
221 gsc->fwver = reg; in gsc_probe()
223 regmap_read(gsc->regmap, GSC_FW_CRC, &reg); in gsc_probe()
224 gsc->fwcrc = reg; in gsc_probe()
225 regmap_read(gsc->regmap, GSC_FW_CRC + 1, &reg); in gsc_probe()
226 gsc->fwcrc |= reg << 8; in gsc_probe()
228 gsc->i2c_hwmon = devm_i2c_new_dummy_device(dev, client->adapter, in gsc_probe()
230 if (IS_ERR(gsc->i2c_hwmon)) { in gsc_probe()
232 return PTR_ERR(gsc->i2c_hwmon); in gsc_probe()
235 ret = devm_regmap_add_irq_chip(dev, gsc->regmap, client->irq, in gsc_probe()
243 gsc->fwver, gsc->fwcrc); in gsc_probe()
245 ret = sysfs_create_group(&dev->kobj, &attr_group); in gsc_probe()
251 sysfs_remove_group(&dev->kobj, &attr_group); in gsc_probe()
260 sysfs_remove_group(&client->dev.kobj, &attr_group); in gsc_remove()
267 .name = "gateworks-gsc",