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",
200 struct gsc_dev *gsc; in gsc_probe() local
205 gsc = devm_kzalloc(dev, sizeof(*gsc), GFP_KERNEL); in gsc_probe()
206 if (!gsc) in gsc_probe()
209 gsc->dev = &client->dev; in gsc_probe()
210 gsc->i2c = client; in gsc_probe()
211 i2c_set_clientdata(client, gsc); in gsc_probe()
213 gsc->regmap = devm_regmap_init(dev, &gsc_regmap_bus, client, in gsc_probe()
215 if (IS_ERR(gsc->regmap)) in gsc_probe()
216 return PTR_ERR(gsc->regmap); in gsc_probe()
218 if (regmap_read(gsc->regmap, GSC_FW_VER, &reg)) in gsc_probe()
220 gsc->fwver = reg; in gsc_probe()
222 regmap_read(gsc->regmap, GSC_FW_CRC, &reg); in gsc_probe()
223 gsc->fwcrc = reg; in gsc_probe()
224 regmap_read(gsc->regmap, GSC_FW_CRC + 1, &reg); in gsc_probe()
225 gsc->fwcrc |= reg << 8; in gsc_probe()
227 gsc->i2c_hwmon = devm_i2c_new_dummy_device(dev, client->adapter, in gsc_probe()
229 if (IS_ERR(gsc->i2c_hwmon)) { in gsc_probe()
231 return PTR_ERR(gsc->i2c_hwmon); in gsc_probe()
234 ret = devm_regmap_add_irq_chip(dev, gsc->regmap, client->irq, in gsc_probe()
242 gsc->fwver, gsc->fwcrc); in gsc_probe()
264 .name = "gateworks-gsc",
273 MODULE_DESCRIPTION("I2C Core interface for GSC");