Lines Matching full:gsc
3 * The Gateworks System Controller (GSC) is a multi-function
15 #include <linux/mfd/gsc.h>
26 * The GSC suffers from an errata where occasionally during
72 * gsc_powerdown - API to use GSC to power down board for a specific time
76 static int gsc_powerdown(struct gsc_dev *gsc, unsigned long secs) in gsc_powerdown() argument
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()
108 struct gsc_dev *gsc = dev_get_drvdata(dev); in gsc_show() local
113 rz = sprintf(buf, "%d\n", gsc->fwver); in gsc_show()
115 rz = sprintf(buf, "0x%04x\n", gsc->fwcrc); in gsc_show()
125 struct gsc_dev *gsc = dev_get_drvdata(dev); in gsc_store() local
131 gsc_powerdown(gsc, value); in gsc_store()
158 { .compatible = "gw,gsc", },
187 .name = "gateworks-gsc",
201 struct gsc_dev *gsc; in gsc_probe() local
206 gsc = devm_kzalloc(dev, sizeof(*gsc), GFP_KERNEL); in gsc_probe()
207 if (!gsc) in gsc_probe()
210 gsc->dev = &client->dev; in gsc_probe()
211 gsc->i2c = client; in gsc_probe()
212 i2c_set_clientdata(client, gsc); 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, ®)) in gsc_probe()
221 gsc->fwver = reg; in gsc_probe()
223 regmap_read(gsc->regmap, GSC_FW_CRC, ®); in gsc_probe()
224 gsc->fwcrc = reg; in gsc_probe()
225 regmap_read(gsc->regmap, GSC_FW_CRC + 1, ®); 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()
267 .name = "gateworks-gsc",
276 MODULE_DESCRIPTION("I2C Core interface for GSC");