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()
315 struct gsc_hwmon_data *hwmon; in gsc_hwmon_probe() local
325 hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL); in gsc_hwmon_probe()
326 if (!hwmon) in gsc_hwmon_probe()
328 hwmon->gsc = gsc; in gsc_hwmon_probe()
329 hwmon->pdata = pdata; in gsc_hwmon_probe()
331 hwmon->regmap = devm_regmap_init(dev, &gsc_hwmon_regmap_bus, in gsc_hwmon_probe()
334 if (IS_ERR(hwmon->regmap)) in gsc_hwmon_probe()
335 return PTR_ERR(hwmon->regmap); in gsc_hwmon_probe()
337 for (i = 0, i_in = 0, i_temp = 0, i_fan = 0; i < hwmon->pdata->nchannels; i++) { in gsc_hwmon_probe()
346 hwmon->temp_ch[i_temp] = ch; in gsc_hwmon_probe()
347 hwmon->temp_config[i_temp] = HWMON_T_INPUT | in gsc_hwmon_probe()
356 hwmon->fan_ch[i_fan] = ch; in gsc_hwmon_probe()
357 hwmon->fan_config[i_fan] = HWMON_F_INPUT | in gsc_hwmon_probe()
368 hwmon->in_ch[i_in] = ch; in gsc_hwmon_probe()
369 hwmon->in_config[i_in] = in gsc_hwmon_probe()
380 hwmon->chip.ops = &gsc_hwmon_ops; in gsc_hwmon_probe()
381 hwmon->chip.info = hwmon->info; in gsc_hwmon_probe()
382 hwmon->info[0] = &hwmon->temp_info; in gsc_hwmon_probe()
383 hwmon->info[1] = &hwmon->in_info; in gsc_hwmon_probe()
384 hwmon->info[2] = &hwmon->fan_info; in gsc_hwmon_probe()
385 hwmon->temp_info.type = hwmon_temp; in gsc_hwmon_probe()
386 hwmon->temp_info.config = hwmon->temp_config; in gsc_hwmon_probe()
387 hwmon->in_info.type = hwmon_in; in gsc_hwmon_probe()
388 hwmon->in_info.config = hwmon->in_config; in gsc_hwmon_probe()
389 hwmon->fan_info.type = hwmon_fan; in gsc_hwmon_probe()
390 hwmon->fan_info.config = hwmon->fan_config; in gsc_hwmon_probe()
394 KBUILD_MODNAME, hwmon, in gsc_hwmon_probe()
395 &hwmon->chip, groups); in gsc_hwmon_probe()
407 .name = "gsc-hwmon",