Home
last modified time | relevance | path

Searched refs:hwmon (Results 1 – 25 of 68) sorted by relevance

123

/drivers/hwmon/
Dda9052-hwmon.c67 static inline int input_tsireg_to_mv(struct da9052_hwmon *hwmon, int value) in input_tsireg_to_mv() argument
69 return DIV_ROUND_CLOSEST(value * hwmon->tsiref_mv, 1023); in input_tsireg_to_mv()
88 struct da9052_hwmon *hwmon = dev_get_drvdata(dev); in da9052_vddout_show() local
91 mutex_lock(&hwmon->hwmon_lock); in da9052_vddout_show()
93 ret = da9052_enable_vddout_channel(hwmon->da9052); in da9052_vddout_show()
97 vdd = da9052_reg_read(hwmon->da9052, DA9052_VDD_RES_REG); in da9052_vddout_show()
103 ret = da9052_disable_vddout_channel(hwmon->da9052); in da9052_vddout_show()
107 mutex_unlock(&hwmon->hwmon_lock); in da9052_vddout_show()
111 da9052_disable_vddout_channel(hwmon->da9052); in da9052_vddout_show()
113 mutex_unlock(&hwmon->hwmon_lock); in da9052_vddout_show()
[all …]
Dlan966x-hwmon.c80 struct lan966x_hwmon *hwmon = dev_get_drvdata(dev); in lan966x_hwmon_read_temp() local
84 ret = regmap_read(hwmon->regmap_pvt, PVT_SENSOR_STAT, &data); in lan966x_hwmon_read_temp()
99 struct lan966x_hwmon *hwmon = dev_get_drvdata(dev); in lan966x_hwmon_read_fan() local
103 ret = regmap_read(hwmon->regmap_fan, FAN_CNT, &data); in lan966x_hwmon_read_fan()
118 struct lan966x_hwmon *hwmon = dev_get_drvdata(dev); in lan966x_hwmon_read_pwm() local
122 ret = regmap_read(hwmon->regmap_fan, FAN_CFG, &data); in lan966x_hwmon_read_pwm()
133 struct lan966x_hwmon *hwmon = dev_get_drvdata(dev); in lan966x_hwmon_read_pwm_freq() local
138 ret = regmap_read(hwmon->regmap_fan, FAN_PWM_FREQ, &data); in lan966x_hwmon_read_pwm_freq()
147 tmp = DIV_ROUND_CLOSEST(hwmon->clk_rate, 256); in lan966x_hwmon_read_pwm_freq()
177 struct lan966x_hwmon *hwmon = dev_get_drvdata(dev); in lan966x_hwmon_write_pwm() local
[all …]
Dgsc-hwmon.c57 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()
[all …]
Dnsa320-hwmon.c72 struct nsa320_hwmon *hwmon = dev_get_drvdata(dev); in nsa320_hwmon_update() local
74 mutex_lock(&hwmon->update_lock); in nsa320_hwmon_update()
76 mcu_data = hwmon->mcu_data; in nsa320_hwmon_update()
78 if (time_after(jiffies, hwmon->last_updated + HZ) || mcu_data == 0) { in nsa320_hwmon_update()
79 gpiod_set_value(hwmon->act, 1); in nsa320_hwmon_update()
84 gpiod_set_value(hwmon->clk, 0); in nsa320_hwmon_update()
86 gpiod_set_value(hwmon->clk, 1); in nsa320_hwmon_update()
88 if (gpiod_get_value(hwmon->data)) in nsa320_hwmon_update()
92 gpiod_set_value(hwmon->act, 0); in nsa320_hwmon_update()
99 hwmon->mcu_data = mcu_data; in nsa320_hwmon_update()
[all …]
Dda9055-hwmon.c55 static int da9055_adc_manual_read(struct da9055_hwmon *hwmon, in da9055_adc_manual_read() argument
62 struct da9055 *da9055 = hwmon->da9055; in da9055_adc_manual_read()
67 mutex_lock(&hwmon->irq_lock); in da9055_adc_manual_read()
77 if (!wait_for_completion_timeout(&hwmon->done, in da9055_adc_manual_read()
102 mutex_unlock(&hwmon->irq_lock); in da9055_adc_manual_read()
108 struct da9055_hwmon *hwmon = irq_data; in da9055_auxadc_irq() local
110 complete(&hwmon->done); in da9055_auxadc_irq()
142 struct da9055_hwmon *hwmon = dev_get_drvdata(dev); in da9055_auto_ch_show() local
146 mutex_lock(&hwmon->hwmon_lock); in da9055_auto_ch_show()
148 ret = da9055_enable_auto_mode(hwmon->da9055, channel); in da9055_auto_ch_show()
[all …]
Dsparx5-temp.c29 static void s5_temp_enable(struct s5_hwmon *hwmon) in s5_temp_enable() argument
31 u32 val = readl(hwmon->base + TEMP_CFG); in s5_temp_enable()
32 u32 clk = clk_get_rate(hwmon->clk) / USEC_PER_SEC; in s5_temp_enable()
38 writel(val, hwmon->base + TEMP_CFG); in s5_temp_enable()
44 struct s5_hwmon *hwmon = dev_get_drvdata(dev); in s5_read() local
50 stat = readl_relaxed(hwmon->base + TEMP_STAT); in s5_read()
108 struct s5_hwmon *hwmon; in s5_temp_probe() local
110 hwmon = devm_kzalloc(&pdev->dev, sizeof(*hwmon), GFP_KERNEL); in s5_temp_probe()
111 if (!hwmon) in s5_temp_probe()
114 hwmon->base = devm_platform_ioremap_resource(pdev, 0); in s5_temp_probe()
[all …]
Ds3c-hwmon.c59 struct s3c_hwmon *hwmon, int channel) in s3c_hwmon_read_ch() argument
63 ret = mutex_lock_interruptible(&hwmon->lock); in s3c_hwmon_read_ch()
69 ret = s3c_adc_read(hwmon->client, channel); in s3c_hwmon_read_ch()
70 mutex_unlock(&hwmon->lock); in s3c_hwmon_read_ch()
155 struct s3c_hwmon *hwmon = dev_get_drvdata(dev); in s3c_hwmon_ch_show() local
162 ret = s3c_hwmon_read_ch(dev, hwmon, sen_attr->index); in s3c_hwmon_ch_show()
266 struct s3c_hwmon *hwmon; in s3c_hwmon_probe() local
275 hwmon = devm_kzalloc(&dev->dev, sizeof(struct s3c_hwmon), GFP_KERNEL); in s3c_hwmon_probe()
276 if (hwmon == NULL) in s3c_hwmon_probe()
279 platform_set_drvdata(dev, hwmon); in s3c_hwmon_probe()
[all …]
Das370-hwmon.c31 static void init_pvt(struct as370_hwmon *hwmon) in init_pvt() argument
34 void __iomem *addr = hwmon->base + CTRL; in init_pvt()
50 struct as370_hwmon *hwmon = dev_get_drvdata(dev); in as370_hwmon_read() local
54 val = readl_relaxed(hwmon->base + STS) & BN_MASK; in as370_hwmon_read()
97 struct as370_hwmon *hwmon; in as370_hwmon_probe() local
100 hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL); in as370_hwmon_probe()
101 if (!hwmon) in as370_hwmon_probe()
104 hwmon->base = devm_platform_ioremap_resource(pdev, 0); in as370_hwmon_probe()
105 if (IS_ERR(hwmon->base)) in as370_hwmon_probe()
106 return PTR_ERR(hwmon->base); in as370_hwmon_probe()
[all …]
Dsl28cpld-hwmon.c37 struct sl28cpld_hwmon *hwmon = dev_get_drvdata(dev); in sl28cpld_hwmon_read() local
43 ret = regmap_read(hwmon->regmap, hwmon->offset + FAN_INPUT, in sl28cpld_hwmon_read()
87 struct sl28cpld_hwmon *hwmon; in sl28cpld_hwmon_probe() local
94 hwmon = devm_kzalloc(&pdev->dev, sizeof(*hwmon), GFP_KERNEL); in sl28cpld_hwmon_probe()
95 if (!hwmon) in sl28cpld_hwmon_probe()
98 hwmon->regmap = dev_get_regmap(pdev->dev.parent, NULL); in sl28cpld_hwmon_probe()
99 if (!hwmon->regmap) in sl28cpld_hwmon_probe()
102 ret = device_property_read_u32(&pdev->dev, "reg", &hwmon->offset); in sl28cpld_hwmon_probe()
107 "sl28cpld_hwmon", hwmon, in sl28cpld_hwmon_probe()
DMakefile6 obj-$(CONFIG_HWMON) += hwmon.o
7 obj-$(CONFIG_HWMON_VID) += hwmon-vid.o
52 obj-$(CONFIG_SENSORS_ARM_SCMI) += scmi-hwmon.o
53 obj-$(CONFIG_SENSORS_ARM_SCPI) += scpi-hwmon.o
54 obj-$(CONFIG_SENSORS_AS370) += as370-hwmon.o
63 obj-$(CONFIG_SENSORS_DA9052_ADC)+= da9052-hwmon.o
64 obj-$(CONFIG_SENSORS_DA9055)+= da9055-hwmon.o
65 obj-$(CONFIG_SENSORS_DELL_SMM) += dell-smm-hwmon.o
84 obj-$(CONFIG_SENSORS_GSC) += gsc-hwmon.o
98 obj-$(CONFIG_SENSORS_INTEL_M10_BMC_HWMON) += intel-m10-bmc-hwmon.o
[all …]
Dnzxt-smart2.c175 struct device *hwmon; member
759 drvdata->hwmon = in nzxt_smart2_hid_probe()
762 if (IS_ERR(drvdata->hwmon)) { in nzxt_smart2_hid_probe()
763 ret = PTR_ERR(drvdata->hwmon); in nzxt_smart2_hid_probe()
781 hwmon_device_unregister(drvdata->hwmon); in nzxt_smart2_hid_remove()
/drivers/thermal/
Dthermal_hwmon.c91 struct thermal_hwmon_device *hwmon; in thermal_hwmon_lookup_by_type() local
95 list_for_each_entry(hwmon, &thermal_hwmon_list, node) { in thermal_hwmon_lookup_by_type()
98 if (!strcmp(hwmon->type, type)) { in thermal_hwmon_lookup_by_type()
100 return hwmon; in thermal_hwmon_lookup_by_type()
110 thermal_hwmon_lookup_temp(const struct thermal_hwmon_device *hwmon, in thermal_hwmon_lookup_temp() argument
116 list_for_each_entry(temp, &hwmon->tz_list, hwmon_node) in thermal_hwmon_lookup_temp()
134 struct thermal_hwmon_device *hwmon; in thermal_add_hwmon_sysfs() local
139 hwmon = thermal_hwmon_lookup_by_type(tz); in thermal_add_hwmon_sysfs()
140 if (hwmon) { in thermal_add_hwmon_sysfs()
145 hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); in thermal_add_hwmon_sysfs()
[all …]
/drivers/net/ethernet/sfc/
Dmcdi_mon.c146 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_update() local
151 hwmon->dma_buf.dma_addr); in efx_mcdi_mon_update()
152 MCDI_SET_DWORD(inbuf, READ_SENSORS_EXT_IN_LENGTH, hwmon->dma_buf.len); in efx_mcdi_mon_update()
157 hwmon->last_update = jiffies; in efx_mcdi_mon_update()
165 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_get_entry() local
170 mutex_lock(&hwmon->update_lock); in efx_mcdi_mon_get_entry()
173 if (time_before(jiffies, hwmon->last_update + HZ)) in efx_mcdi_mon_get_entry()
179 *entry = ((efx_dword_t *)hwmon->dma_buf.addr)[index]; in efx_mcdi_mon_get_entry()
181 mutex_unlock(&hwmon->update_lock); in efx_mcdi_mon_get_entry()
285 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_add_attr() local
[all …]
/drivers/net/ethernet/sfc/siena/
Dmcdi_mon.c146 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_update() local
151 hwmon->dma_buf.dma_addr); in efx_mcdi_mon_update()
152 MCDI_SET_DWORD(inbuf, READ_SENSORS_EXT_IN_LENGTH, hwmon->dma_buf.len); in efx_mcdi_mon_update()
157 hwmon->last_update = jiffies; in efx_mcdi_mon_update()
165 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_get_entry() local
170 mutex_lock(&hwmon->update_lock); in efx_mcdi_mon_get_entry()
173 if (time_before(jiffies, hwmon->last_update + HZ)) in efx_mcdi_mon_get_entry()
179 *entry = ((efx_dword_t *)hwmon->dma_buf.addr)[index]; in efx_mcdi_mon_get_entry()
181 mutex_unlock(&hwmon->update_lock); in efx_mcdi_mon_get_entry()
285 struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); in efx_mcdi_mon_add_attr() local
[all …]
/drivers/hwmon/occ/
DMakefile2 occ-hwmon-common-objs := common.o sysfs.o
3 occ-p8-hwmon-objs := p8_i2c.o
4 occ-p9-hwmon-objs := p9_sbe.o
6 obj-$(CONFIG_SENSORS_OCC) += occ-hwmon-common.o
7 obj-$(CONFIG_SENSORS_OCC_P8_I2C) += occ-p8-hwmon.o
8 obj-$(CONFIG_SENSORS_OCC_P9_SBE) += occ-p9-hwmon.o
Dcommon.c1185 occ->hwmon = hwmon_device_register_with_groups(occ->bus_dev, in occ_active()
1188 if (IS_ERR(occ->hwmon)) { in occ_active()
1189 rc = PTR_ERR(occ->hwmon); in occ_active()
1190 occ->hwmon = NULL; in occ_active()
1201 if (occ->hwmon) in occ_active()
1202 hwmon_device_unregister(occ->hwmon); in occ_active()
1204 occ->hwmon = NULL; in occ_active()
1241 if (occ->hwmon) in occ_shutdown()
1242 hwmon_device_unregister(occ->hwmon); in occ_shutdown()
1243 occ->hwmon = NULL; in occ_shutdown()
/drivers/net/ethernet/mellanox/mlxsw/
Dcore_hwmon.c46 struct mlxsw_hwmon *hwmon; member
72 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_temp_show()
97 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_temp_max_show()
122 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_temp_rst_store()
159 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_fan_rpm_show()
179 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_fan_fault_show()
201 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_pwm_show()
222 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_pwm_store()
249 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_module_temp_get()
288 struct mlxsw_hwmon *mlxsw_hwmon = mlxsw_hwmon_dev->hwmon; in mlxsw_hwmon_module_temp_fault_show()
[all …]
/drivers/gpu/drm/nouveau/
Dnouveau_hwmon.c671 struct nouveau_hwmon *hwmon; in nouveau_hwmon_init() local
681 hwmon = drm->hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL); in nouveau_hwmon_init()
682 if (!hwmon) in nouveau_hwmon_init()
684 hwmon->dev = dev; in nouveau_hwmon_init()
703 hwmon->hwmon = hwmon_dev; in nouveau_hwmon_init()
714 struct nouveau_hwmon *hwmon = nouveau_hwmon(dev); in nouveau_hwmon_fini() local
716 if (!hwmon) in nouveau_hwmon_fini()
719 if (hwmon->hwmon) in nouveau_hwmon_fini()
720 hwmon_device_unregister(hwmon->hwmon); in nouveau_hwmon_fini()
722 nouveau_drm(dev)->hwmon = NULL; in nouveau_hwmon_fini()
[all …]
Dnouveau_hwmon.h30 struct device *hwmon; member
36 return nouveau_drm(dev)->hwmon; in nouveau_hwmon()
/drivers/nvme/host/
Dhwmon.c230 struct device *hwmon; in nvme_hwmon_init() local
252 hwmon = hwmon_device_register_with_info(dev, "nvme", in nvme_hwmon_init()
255 if (IS_ERR(hwmon)) { in nvme_hwmon_init()
257 err = PTR_ERR(hwmon); in nvme_hwmon_init()
260 ctrl->hwmon_device = hwmon; in nvme_hwmon_init()
/drivers/platform/mellanox/
Dmlxreg-io.c39 struct device *hwmon; member
251 priv->hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, in mlxreg_io_probe()
255 if (IS_ERR(priv->hwmon)) { in mlxreg_io_probe()
257 PTR_ERR(priv->hwmon)); in mlxreg_io_probe()
258 return PTR_ERR(priv->hwmon); in mlxreg_io_probe()
Dmlxreg-hotplug.c62 struct device *hwmon; member
110 mlxreg_hotplug_udev_event_send(&priv->hwmon->kobj, data, true); in mlxreg_hotplug_device_create()
180 mlxreg_hotplug_udev_event_send(&priv->hwmon->kobj, data, false); in mlxreg_hotplug_device_destroy()
757 priv->hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, in mlxreg_hotplug_probe()
759 if (IS_ERR(priv->hwmon)) { in mlxreg_hotplug_probe()
761 PTR_ERR(priv->hwmon)); in mlxreg_hotplug_probe()
762 return PTR_ERR(priv->hwmon); in mlxreg_hotplug_probe()
/drivers/ufs/core/
Dufs-hwmon.c169 struct device *hwmon; in ufs_hwmon_probe() local
178 hwmon = hwmon_device_register_with_info(dev, "ufs", data, &ufs_hwmon_hba_info, NULL); in ufs_hwmon_probe()
179 if (IS_ERR(hwmon)) { in ufs_hwmon_probe()
185 hba->hwmon_device = hwmon; in ufs_hwmon_probe()
/drivers/fpga/
Ddfl-fme-main.c317 struct device *hwmon; in fme_thermal_mgmt_init() local
337 hwmon = devm_hwmon_device_register_with_info(&pdev->dev, in fme_thermal_mgmt_init()
341 if (IS_ERR(hwmon)) { in fme_thermal_mgmt_init()
343 return PTR_ERR(hwmon); in fme_thermal_mgmt_init()
538 struct device *hwmon; in fme_power_mgmt_init() local
540 hwmon = devm_hwmon_device_register_with_info(&pdev->dev, in fme_power_mgmt_init()
544 if (IS_ERR(hwmon)) { in fme_power_mgmt_init()
546 return PTR_ERR(hwmon); in fme_power_mgmt_init()
/drivers/input/touchscreen/
Dsun4i-ts.c239 struct device *hwmon; in sun4i_ts_probe() local
354 hwmon = devm_hwmon_device_register_with_groups(ts->dev, "sun4i_ts", in sun4i_ts_probe()
356 if (IS_ERR(hwmon)) in sun4i_ts_probe()
357 return PTR_ERR(hwmon); in sun4i_ts_probe()

123