Lines Matching full:hwmon

7 #include <linux/hwmon.h>
8 #include <linux/hwmon-sysfs.h>
57 struct gsc_hwmon_data *hwmon = dev_get_drvdata(dev); in pwm_auto_point_temp_show() local
59 u8 reg = hwmon->pdata->fan_base + (2 * attr->index); in pwm_auto_point_temp_show()
63 ret = regmap_bulk_read(hwmon->regmap, reg, regs, 2); in pwm_auto_point_temp_show()
75 struct gsc_hwmon_data *hwmon = dev_get_drvdata(dev); in pwm_auto_point_temp_store() local
77 u8 reg = hwmon->pdata->fan_base + (2 * attr->index); in pwm_auto_point_temp_store()
90 err = regmap_bulk_write(hwmon->regmap, reg, regs, 2); in pwm_auto_point_temp_store()
149 struct gsc_hwmon_data *hwmon = dev_get_drvdata(dev); in gsc_hwmon_read() local
157 ch = hwmon->in_ch[channel]; in gsc_hwmon_read()
160 ch = hwmon->temp_ch[channel]; in gsc_hwmon_read()
163 ch = hwmon->fan_ch[channel]; in gsc_hwmon_read()
170 ret = regmap_bulk_read(hwmon->regmap, ch->reg, buf, sz); in gsc_hwmon_read()
215 struct gsc_hwmon_data *hwmon = dev_get_drvdata(dev); in gsc_hwmon_read_string() local
219 *buf = hwmon->in_ch[channel]->name; in gsc_hwmon_read_string()
222 *buf = hwmon->temp_ch[channel]->name; in gsc_hwmon_read_string()
225 *buf = hwmon->fan_ch[channel]->name; in gsc_hwmon_read_string()
318 struct gsc_hwmon_data *hwmon; in gsc_hwmon_probe() local
328 hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL); in gsc_hwmon_probe()
329 if (!hwmon) in gsc_hwmon_probe()
331 hwmon->gsc = gsc; in gsc_hwmon_probe()
332 hwmon->pdata = pdata; in gsc_hwmon_probe()
334 hwmon->regmap = devm_regmap_init(dev, &gsc_hwmon_regmap_bus, in gsc_hwmon_probe()
337 if (IS_ERR(hwmon->regmap)) in gsc_hwmon_probe()
338 return PTR_ERR(hwmon->regmap); in gsc_hwmon_probe()
340 for (i = 0, i_in = 0, i_temp = 0, i_fan = 0; i < hwmon->pdata->nchannels; i++) { in gsc_hwmon_probe()
349 hwmon->temp_ch[i_temp] = ch; in gsc_hwmon_probe()
350 hwmon->temp_config[i_temp] = HWMON_T_INPUT | in gsc_hwmon_probe()
359 hwmon->fan_ch[i_fan] = ch; in gsc_hwmon_probe()
360 hwmon->fan_config[i_fan] = HWMON_F_INPUT | in gsc_hwmon_probe()
371 hwmon->in_ch[i_in] = ch; in gsc_hwmon_probe()
372 hwmon->in_config[i_in] = in gsc_hwmon_probe()
383 hwmon->chip.ops = &gsc_hwmon_ops; in gsc_hwmon_probe()
384 hwmon->chip.info = hwmon->info; in gsc_hwmon_probe()
385 hwmon->info[0] = &hwmon->temp_info; in gsc_hwmon_probe()
386 hwmon->info[1] = &hwmon->in_info; in gsc_hwmon_probe()
387 hwmon->info[2] = &hwmon->fan_info; in gsc_hwmon_probe()
388 hwmon->temp_info.type = hwmon_temp; in gsc_hwmon_probe()
389 hwmon->temp_info.config = hwmon->temp_config; in gsc_hwmon_probe()
390 hwmon->in_info.type = hwmon_in; in gsc_hwmon_probe()
391 hwmon->in_info.config = hwmon->in_config; in gsc_hwmon_probe()
392 hwmon->fan_info.type = hwmon_fan; in gsc_hwmon_probe()
393 hwmon->fan_info.config = hwmon->fan_config; in gsc_hwmon_probe()
397 KBUILD_MODNAME, hwmon, in gsc_hwmon_probe()
398 &hwmon->chip, groups); in gsc_hwmon_probe()
409 .name = "gsc-hwmon",