]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drivers: thermal: tsens: Rename tsens_device
authorAmit Kucheria <amit.kucheria@linaro.org>
Wed, 20 Mar 2019 13:17:43 +0000 (18:47 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 14 May 2019 03:35:35 +0000 (20:35 -0700)
Rename to tsens_priv to denote that it is private data for each tsens
instance.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/qcom/tsens-8916.c
drivers/thermal/qcom/tsens-8960.c
drivers/thermal/qcom/tsens-8974.c
drivers/thermal/qcom/tsens-common.c
drivers/thermal/qcom/tsens-v2.c
drivers/thermal/qcom/tsens.c
drivers/thermal/qcom/tsens.h

index 66edcfca152621fafb2fee8dc5a027196c49c10e..7b8f83c9a0331a392f5ac896ca9881e34a51682e 100644 (file)
@@ -39,7 +39,7 @@
 #define CAL_SEL_MASK   0xe0000000
 #define CAL_SEL_SHIFT  29
 
-static int calibrate_8916(struct tsens_device *tmdev)
+static int calibrate_8916(struct tsens_priv *tmdev)
 {
        int base0 = 0, base1 = 0, i;
        u32 p1[5], p2[5];
index f3c3820e6e8e6487a894c9da49f862aa01d71bf2..7e340eea48da3ca8e67cb21b2102917f84852092 100644 (file)
@@ -56,7 +56,7 @@
 #define TRDY_MASK              BIT(7)
 #define TIMEOUT_US             100
 
-static int suspend_8960(struct tsens_device *tmdev)
+static int suspend_8960(struct tsens_priv *tmdev)
 {
        int ret;
        unsigned int mask;
@@ -82,7 +82,7 @@ static int suspend_8960(struct tsens_device *tmdev)
        return 0;
 }
 
-static int resume_8960(struct tsens_device *tmdev)
+static int resume_8960(struct tsens_priv *tmdev)
 {
        int ret;
        struct regmap *map = tmdev->tm_map;
@@ -112,7 +112,7 @@ static int resume_8960(struct tsens_device *tmdev)
        return 0;
 }
 
-static int enable_8960(struct tsens_device *tmdev, int id)
+static int enable_8960(struct tsens_priv *tmdev, int id)
 {
        int ret;
        u32 reg, mask;
@@ -138,7 +138,7 @@ static int enable_8960(struct tsens_device *tmdev, int id)
        return 0;
 }
 
-static void disable_8960(struct tsens_device *tmdev)
+static void disable_8960(struct tsens_priv *tmdev)
 {
        int ret;
        u32 reg_cntl;
@@ -162,7 +162,7 @@ static void disable_8960(struct tsens_device *tmdev)
        regmap_write(tmdev->tm_map, CNTL_ADDR, reg_cntl);
 }
 
-static int init_8960(struct tsens_device *tmdev)
+static int init_8960(struct tsens_priv *tmdev)
 {
        int ret, i;
        u32 reg_cntl;
@@ -212,7 +212,7 @@ static int init_8960(struct tsens_device *tmdev)
        return 0;
 }
 
-static int calibrate_8960(struct tsens_device *tmdev)
+static int calibrate_8960(struct tsens_priv *tmdev)
 {
        int i;
        char *data;
@@ -243,7 +243,7 @@ static inline int code_to_mdegC(u32 adc_code, const struct tsens_sensor *s)
        return adc_code * slope + offset;
 }
 
-static int get_temp_8960(struct tsens_device *tmdev, int id, int *temp)
+static int get_temp_8960(struct tsens_priv *tmdev, int id, int *temp)
 {
        int ret;
        u32 code, trdy;
index 5023f20afc140c593724aeebc2309c677d06b04e..f983f98f21767c463d8cd58ed3959a0b15d50ef0 100644 (file)
@@ -91,7 +91,7 @@
 
 #define BIT_APPEND             0x3
 
-static int calibrate_8974(struct tsens_device *tmdev)
+static int calibrate_8974(struct tsens_priv *tmdev)
 {
        int base1 = 0, base2 = 0, i;
        u32 p1[11], p2[11];
index f80c73f117406b587e9b2a5c38bd7e337eca2b9b..46f8c68c70f56952d5387de346bedfc64c855aef 100644 (file)
@@ -46,7 +46,7 @@ char *qfprom_read(struct device *dev, const char *cname)
  * and offset values are derived from tz->tzp->slope and tz->tzp->offset
  * resp.
  */
-void compute_intercept_slope(struct tsens_device *tmdev, u32 *p1,
+void compute_intercept_slope(struct tsens_priv *tmdev, u32 *p1,
                             u32 *p2, u32 mode)
 {
        int i;
@@ -95,7 +95,7 @@ static inline int code_to_degc(u32 adc_code, const struct tsens_sensor *s)
        return degc;
 }
 
-int get_temp_common(struct tsens_device *tmdev, int id, int *temp)
+int get_temp_common(struct tsens_priv *tmdev, int id, int *temp)
 {
        struct tsens_sensor *s = &tmdev->sensor[id];
        u32 code;
@@ -127,7 +127,7 @@ static const struct regmap_config tsens_srot_config = {
        .reg_stride     = 4,
 };
 
-int __init init_common(struct tsens_device *tmdev)
+int __init init_common(struct tsens_priv *tmdev)
 {
        void __iomem *tm_base, *srot_base;
        struct resource *res;
index cc98a61e093bfff8babe696a449a49180e6605bb..d812fd3f4567e339c8668c9018fa829de4a78500 100644 (file)
@@ -12,7 +12,7 @@
 #define LAST_TEMP_MASK         0xfff
 #define STATUS_VALID_BIT       BIT(21)
 
-static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp)
+static int get_temp_tsens_v2(struct tsens_priv *tmdev, int id, int *temp)
 {
        struct tsens_sensor *s = &tmdev->sensor[id];
        u32 code;
index 065ec2189bd399cd36c234107e04672080a6ceb7..074fbb4d70f21dcf1e7cee14c699e06054e4678b 100644 (file)
@@ -15,7 +15,7 @@
 static int tsens_get_temp(void *data, int *temp)
 {
        const struct tsens_sensor *s = data;
-       struct tsens_device *tmdev = s->tmdev;
+       struct tsens_priv *tmdev = s->tmdev;
 
        return tmdev->ops->get_temp(tmdev, s->id, temp);
 }
@@ -23,7 +23,7 @@ static int tsens_get_temp(void *data, int *temp)
 static int tsens_get_trend(void *p, int trip, enum thermal_trend *trend)
 {
        const struct tsens_sensor *s = p;
-       struct tsens_device *tmdev = s->tmdev;
+       struct tsens_priv *tmdev = s->tmdev;
 
        if (tmdev->ops->get_trend)
                return  tmdev->ops->get_trend(tmdev, s->id, trend);
@@ -33,7 +33,7 @@ static int tsens_get_trend(void *p, int trip, enum thermal_trend *trend)
 
 static int  __maybe_unused tsens_suspend(struct device *dev)
 {
-       struct tsens_device *tmdev = dev_get_drvdata(dev);
+       struct tsens_priv *tmdev = dev_get_drvdata(dev);
 
        if (tmdev->ops && tmdev->ops->suspend)
                return tmdev->ops->suspend(tmdev);
@@ -43,7 +43,7 @@ static int  __maybe_unused tsens_suspend(struct device *dev)
 
 static int __maybe_unused tsens_resume(struct device *dev)
 {
-       struct tsens_device *tmdev = dev_get_drvdata(dev);
+       struct tsens_priv *tmdev = dev_get_drvdata(dev);
 
        if (tmdev->ops && tmdev->ops->resume)
                return tmdev->ops->resume(tmdev);
@@ -76,7 +76,7 @@ static const struct thermal_zone_of_device_ops tsens_of_ops = {
        .get_trend = tsens_get_trend,
 };
 
-static int tsens_register(struct tsens_device *tmdev)
+static int tsens_register(struct tsens_priv *tmdev)
 {
        int i;
        struct thermal_zone_device *tzd;
@@ -101,7 +101,7 @@ static int tsens_probe(struct platform_device *pdev)
        int ret, i;
        struct device *dev;
        struct device_node *np;
-       struct tsens_device *tmdev;
+       struct tsens_priv *tmdev;
        const struct tsens_plat_data *data;
        const struct of_device_id *id;
        u32 num_sensors;
@@ -174,7 +174,7 @@ static int tsens_probe(struct platform_device *pdev)
 
 static int tsens_remove(struct platform_device *pdev)
 {
-       struct tsens_device *tmdev = platform_get_drvdata(pdev);
+       struct tsens_priv *tmdev = platform_get_drvdata(pdev);
 
        if (tmdev->ops->disable)
                tmdev->ops->disable(tmdev);
index 232376c690cc0a12154b454f1493ba7178e6cfdd..936bdc7b1bc23eab58b62e7f59273fc0c462ab7b 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <linux/thermal.h>
 
-struct tsens_device;
+struct tsens_priv;
 
 /**
  * struct tsens_sensor - data for each sensor connected to the tsens device
@@ -25,7 +25,7 @@ struct tsens_device;
  * @status: 8960-specific variable to track 8960 and 8660 status register offset
  */
 struct tsens_sensor {
-       struct tsens_device             *tmdev;
+       struct tsens_priv               *tmdev;
        struct thermal_zone_device      *tzd;
        int                             offset;
        int                             id;
@@ -47,15 +47,15 @@ struct tsens_sensor {
  */
 struct tsens_ops {
        /* mandatory callbacks */
-       int (*init)(struct tsens_device *);
-       int (*calibrate)(struct tsens_device *);
-       int (*get_temp)(struct tsens_device *, int, int *);
+       int (*init)(struct tsens_priv *);
+       int (*calibrate)(struct tsens_priv *);
+       int (*get_temp)(struct tsens_priv *, int, int *);
        /* optional callbacks */
-       int (*enable)(struct tsens_device *, int);
-       void (*disable)(struct tsens_device *);
-       int (*suspend)(struct tsens_device *);
-       int (*resume)(struct tsens_device *);
-       int (*get_trend)(struct tsens_device *, int, enum thermal_trend *);
+       int (*enable)(struct tsens_priv *, int);
+       void (*disable)(struct tsens_priv *);
+       int (*suspend)(struct tsens_priv *);
+       int (*resume)(struct tsens_priv *);
+       int (*get_trend)(struct tsens_priv *, int, enum thermal_trend *);
 };
 
 enum reg_list {
@@ -87,7 +87,7 @@ struct tsens_context {
 };
 
 /**
- * struct tsens_device - private data for each instance of the tsens IP
+ * struct tsens_priv - private data for each instance of the tsens IP
  * @dev: pointer to struct device
  * @num_sensors: number of sensors enabled on this device
  * @tm_map: pointer to TM register address space
@@ -99,7 +99,7 @@ struct tsens_context {
  * @ops: pointer to list of callbacks supported by this device
  * @sensor: list of sensors attached to this device
  */
-struct tsens_device {
+struct tsens_priv {
        struct device                   *dev;
        u32                             num_sensors;
        struct regmap                   *tm_map;
@@ -112,9 +112,9 @@ struct tsens_device {
 };
 
 char *qfprom_read(struct device *, const char *);
-void compute_intercept_slope(struct tsens_device *, u32 *, u32 *, u32);
-int init_common(struct tsens_device *);
-int get_temp_common(struct tsens_device *, int, int *);
+void compute_intercept_slope(struct tsens_priv *, u32 *, u32 *, u32);
+int init_common(struct tsens_priv *);
+int get_temp_common(struct tsens_priv *, int, int *);
 
 /* TSENS v1 targets */
 extern const struct tsens_plat_data data_8916, data_8974, data_8960;