@@ -66,8 +66,9 @@ struct tsensor {
};
struct ths_thermal_chip {
- bool has_mod_clk;
- bool has_bus_clk_reset;
+ bool has_gpadc_clk;
+ bool has_mod_clk;
+ bool has_bus_clk_reset;
bool needs_sram;
int sensor_num;
int offset;
@@ -89,7 +90,8 @@ struct ths_device {
struct regmap_field *sram_regmap_field;
struct reset_control *reset;
struct clk *bus_clk;
- struct clk *mod_clk;
+ struct clk *mod_clk;
+ struct clk *gpadc_clk;
struct tsensor sensor[MAX_SENSOR_NUM];
};
@@ -417,6 +419,16 @@ static int sun8i_ths_resource_init(struct ths_device *tmdev)
if (ret)
return ret;
+ if (tmdev->chip->has_gpadc_clk) {
+ tmdev->gpadc_clk = devm_clk_get_enabled(&pdev->dev, "gpadc");
+ if (IS_ERR(tmdev->gpadc_clk))
+ return PTR_ERR(tmdev->gpadc_clk);
+ }
+
+ ret = clk_prepare_enable(tmdev->gpadc_clk);
+ if (ret)
+ return ret;
+
if (tmdev->chip->needs_sram) {
struct regmap *regmap;