Lines Matching refs:hwmon

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()
322 struct gsc_hwmon_data *hwmon; in gsc_hwmon_probe() local
332 hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL); in gsc_hwmon_probe()
333 if (!hwmon) in gsc_hwmon_probe()
335 hwmon->gsc = gsc; in gsc_hwmon_probe()
336 hwmon->pdata = pdata; in gsc_hwmon_probe()
338 hwmon->regmap = devm_regmap_init(dev, &gsc_hwmon_regmap_bus, in gsc_hwmon_probe()
341 if (IS_ERR(hwmon->regmap)) in gsc_hwmon_probe()
342 return PTR_ERR(hwmon->regmap); in gsc_hwmon_probe()
344 for (i = 0, i_in = 0, i_temp = 0, i_fan = 0; i < hwmon->pdata->nchannels; i++) { in gsc_hwmon_probe()
353 hwmon->temp_ch[i_temp] = ch; in gsc_hwmon_probe()
354 hwmon->temp_config[i_temp] = HWMON_T_INPUT | in gsc_hwmon_probe()
363 hwmon->fan_ch[i_fan] = ch; in gsc_hwmon_probe()
364 hwmon->fan_config[i_fan] = HWMON_F_INPUT | in gsc_hwmon_probe()
375 hwmon->in_ch[i_in] = ch; in gsc_hwmon_probe()
376 hwmon->in_config[i_in] = in gsc_hwmon_probe()
387 hwmon->chip.ops = &gsc_hwmon_ops; in gsc_hwmon_probe()
388 hwmon->chip.info = hwmon->info; in gsc_hwmon_probe()
389 hwmon->info[0] = &hwmon->temp_info; in gsc_hwmon_probe()
390 hwmon->info[1] = &hwmon->in_info; in gsc_hwmon_probe()
391 hwmon->info[2] = &hwmon->fan_info; in gsc_hwmon_probe()
392 hwmon->temp_info.type = hwmon_temp; in gsc_hwmon_probe()
393 hwmon->temp_info.config = hwmon->temp_config; in gsc_hwmon_probe()
394 hwmon->in_info.type = hwmon_in; in gsc_hwmon_probe()
395 hwmon->in_info.config = hwmon->in_config; in gsc_hwmon_probe()
396 hwmon->fan_info.type = hwmon_fan; in gsc_hwmon_probe()
397 hwmon->fan_info.config = hwmon->fan_config; in gsc_hwmon_probe()
401 KBUILD_MODNAME, hwmon, in gsc_hwmon_probe()
402 &hwmon->chip, groups); in gsc_hwmon_probe()