Lines Matching full:hwmon
9 #include <linux/hwmon.h>
36 static void s5_temp_enable(struct s5_hwmon *hwmon) in s5_temp_enable() argument
38 u32 val = readl(hwmon->base + TEMP_CFG); in s5_temp_enable()
39 u32 clk = clk_get_rate(hwmon->clk) / USEC_PER_SEC; in s5_temp_enable()
45 writel(val, hwmon->base + TEMP_CFG); in s5_temp_enable()
51 struct s5_hwmon *hwmon = dev_get_drvdata(dev); in s5_read() local
57 stat = readl_relaxed(hwmon->base + TEMP_STAT); in s5_read()
68 * have millidegrees as specified by the hwmon sysfs in s5_read()
115 struct s5_hwmon *hwmon; in s5_temp_probe() local
118 hwmon = devm_kzalloc(&pdev->dev, sizeof(*hwmon), GFP_KERNEL); in s5_temp_probe()
119 if (!hwmon) in s5_temp_probe()
122 hwmon->base = devm_platform_ioremap_resource(pdev, 0); in s5_temp_probe()
123 if (IS_ERR(hwmon->base)) in s5_temp_probe()
124 return PTR_ERR(hwmon->base); in s5_temp_probe()
126 hwmon->clk = devm_clk_get(&pdev->dev, NULL); in s5_temp_probe()
127 if (IS_ERR(hwmon->clk)) in s5_temp_probe()
128 return PTR_ERR(hwmon->clk); in s5_temp_probe()
130 ret = clk_prepare_enable(hwmon->clk); in s5_temp_probe()
135 hwmon->clk); in s5_temp_probe()
139 s5_temp_enable(hwmon); in s5_temp_probe()
143 hwmon, in s5_temp_probe()