From: kernel test robot <lkp@intel.com> To: thermal-bot for Ansuel Smith <tip-bot2@linutronix.de>, linux-pm@vger.kernel.org Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Ansuel Smith <ansuelsmth@gmail.com>, Thara Gopinath <thara.gopinath@linaro.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, rui.zhang@intel.com, amitk@kernel.org Subject: Re: [thermal: thermal/next] thermal/drivers/tsens: Convert msm8960 to reg_field Date: Fri, 16 Apr 2021 04:27:11 +0800 [thread overview] Message-ID: <202104160443.FvPdV3ZA-lkp@intel.com> (raw) In-Reply-To: <161848823868.29796.2378720492280917598.tip-bot2@tip-bot2> [-- Attachment #1: Type: text/plain, Size: 12121 bytes --] Hi thermal-bot, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.12-rc7] [cannot apply to thermal/next next-20210415] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/thermal-bot-for-Ansuel-Smith/thermal-drivers-tsens-Convert-msm8960-to-reg_field/20210415-200542 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7f75285ca572eaabc028cf78c6ab5473d0d160be config: powerpc-randconfig-r022-20210415 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6a18cc23efad410db48a3ccfc233d215de7d4cb9) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install powerpc cross compiling tool for clang build # apt-get install binutils-powerpc-linux-gnu # https://github.com/0day-ci/linux/commit/efea0f0570b6b581bdb2fad978a35fd1a521385b git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review thermal-bot-for-Ansuel-Smith/thermal-drivers-tsens-Convert-msm8960-to-reg_field/20210415-200542 git checkout efea0f0570b6b581bdb2fad978a35fd1a521385b # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/thermal/qcom/tsens-8960.c:193:29: error: use of undeclared identifier 'S0_STATUS_ADDR' priv->sensor[i].status = S0_STATUS_ADDR + 40; ^ >> drivers/thermal/qcom/tsens-8960.c:284:15: error: use of undeclared identifier 'VER_0' .ver_major = VER_0, ^ 2 errors generated. vim +/S0_STATUS_ADDR +193 drivers/thermal/qcom/tsens-8960.c 20d4fd84bf524ad Rajendra Nayak 2016-05-05 175 69b628ac71f07d6 Amit Kucheria 2019-03-20 176 static int init_8960(struct tsens_priv *priv) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 177 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 178 int ret, i; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 179 u32 reg_cntl; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 180 69b628ac71f07d6 Amit Kucheria 2019-03-20 181 priv->tm_map = dev_get_regmap(priv->dev, NULL); 69b628ac71f07d6 Amit Kucheria 2019-03-20 182 if (!priv->tm_map) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 183 return -ENODEV; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 184 20d4fd84bf524ad Rajendra Nayak 2016-05-05 185 /* 20d4fd84bf524ad Rajendra Nayak 2016-05-05 186 * The status registers for each sensor are discontiguous 20d4fd84bf524ad Rajendra Nayak 2016-05-05 187 * because some SoCs have 5 sensors while others have more 20d4fd84bf524ad Rajendra Nayak 2016-05-05 188 * but the control registers stay in the same place, i.e 20d4fd84bf524ad Rajendra Nayak 2016-05-05 189 * directly after the first 5 status registers. 20d4fd84bf524ad Rajendra Nayak 2016-05-05 190 */ 69b628ac71f07d6 Amit Kucheria 2019-03-20 191 for (i = 0; i < priv->num_sensors; i++) { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 192 if (i >= 5) 69b628ac71f07d6 Amit Kucheria 2019-03-20 @193 priv->sensor[i].status = S0_STATUS_ADDR + 40; 69b628ac71f07d6 Amit Kucheria 2019-03-20 194 priv->sensor[i].status += i * 4; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 195 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 196 20d4fd84bf524ad Rajendra Nayak 2016-05-05 197 reg_cntl = SW_RST; 69b628ac71f07d6 Amit Kucheria 2019-03-20 198 ret = regmap_update_bits(priv->tm_map, CNTL_ADDR, SW_RST, reg_cntl); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 199 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 200 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 201 69b628ac71f07d6 Amit Kucheria 2019-03-20 202 if (priv->num_sensors > 1) { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 203 reg_cntl |= SLP_CLK_ENA | (MEASURE_PERIOD << 18); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 204 reg_cntl &= ~SW_RST; 69b628ac71f07d6 Amit Kucheria 2019-03-20 205 ret = regmap_update_bits(priv->tm_map, CONFIG_ADDR, 20d4fd84bf524ad Rajendra Nayak 2016-05-05 206 CONFIG_MASK, CONFIG); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 207 } else { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 208 reg_cntl |= SLP_CLK_ENA_8660 | (MEASURE_PERIOD << 16); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 209 reg_cntl &= ~CONFIG_MASK_8660; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 210 reg_cntl |= CONFIG_8660 << CONFIG_SHIFT_8660; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 211 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 212 69b628ac71f07d6 Amit Kucheria 2019-03-20 213 reg_cntl |= GENMASK(priv->num_sensors - 1, 0) << SENSOR0_SHIFT; 69b628ac71f07d6 Amit Kucheria 2019-03-20 214 ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 215 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 216 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 217 20d4fd84bf524ad Rajendra Nayak 2016-05-05 218 reg_cntl |= EN; 69b628ac71f07d6 Amit Kucheria 2019-03-20 219 ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 220 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 221 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 222 20d4fd84bf524ad Rajendra Nayak 2016-05-05 223 return 0; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 224 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 225 69b628ac71f07d6 Amit Kucheria 2019-03-20 226 static int calibrate_8960(struct tsens_priv *priv) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 227 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 228 int i; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 229 char *data; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 230 69b628ac71f07d6 Amit Kucheria 2019-03-20 231 ssize_t num_read = priv->num_sensors; 69b628ac71f07d6 Amit Kucheria 2019-03-20 232 struct tsens_sensor *s = priv->sensor; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 233 69b628ac71f07d6 Amit Kucheria 2019-03-20 234 data = qfprom_read(priv->dev, "calib"); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 235 if (IS_ERR(data)) 69b628ac71f07d6 Amit Kucheria 2019-03-20 236 data = qfprom_read(priv->dev, "calib_backup"); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 237 if (IS_ERR(data)) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 238 return PTR_ERR(data); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 239 20d4fd84bf524ad Rajendra Nayak 2016-05-05 240 for (i = 0; i < num_read; i++, s++) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 241 s->offset = data[i]; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 242 6b8249abb093551 Srinivas Kandagatla 2019-08-23 243 kfree(data); 6b8249abb093551 Srinivas Kandagatla 2019-08-23 244 20d4fd84bf524ad Rajendra Nayak 2016-05-05 245 return 0; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 246 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 247 20d4fd84bf524ad Rajendra Nayak 2016-05-05 248 /* Temperature on y axis and ADC-code on x-axis */ 20d4fd84bf524ad Rajendra Nayak 2016-05-05 249 static inline int code_to_mdegC(u32 adc_code, const struct tsens_sensor *s) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 250 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 251 int slope, offset; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 252 20d4fd84bf524ad Rajendra Nayak 2016-05-05 253 slope = thermal_zone_get_slope(s->tzd); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 254 offset = CAL_MDEGC - slope * s->offset; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 255 20d4fd84bf524ad Rajendra Nayak 2016-05-05 256 return adc_code * slope + offset; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 257 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 258 e604bdd2a7e1087 Amit Kucheria 2020-03-12 259 static int get_temp_8960(const struct tsens_sensor *s, int *temp) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 260 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 261 int ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 262 u32 code, trdy; 8b71bce407b3f13 Amit Kucheria 2019-11-01 263 struct tsens_priv *priv = s->priv; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 264 unsigned long timeout; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 265 20d4fd84bf524ad Rajendra Nayak 2016-05-05 266 timeout = jiffies + usecs_to_jiffies(TIMEOUT_US); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 267 do { 69b628ac71f07d6 Amit Kucheria 2019-03-20 268 ret = regmap_read(priv->tm_map, INT_STATUS_ADDR, &trdy); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 269 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 270 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 271 if (!(trdy & TRDY_MASK)) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 272 continue; 69b628ac71f07d6 Amit Kucheria 2019-03-20 273 ret = regmap_read(priv->tm_map, s->status, &code); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 274 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 275 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 276 *temp = code_to_mdegC(code, s); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 277 return 0; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 278 } while (time_before(jiffies, timeout)); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 279 20d4fd84bf524ad Rajendra Nayak 2016-05-05 280 return -ETIMEDOUT; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 281 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 282 efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 283 static struct tsens_features tsens_8960_feat = { efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 @284 .ver_major = VER_0, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 285 .crit_int = 0, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 286 .adc = 1, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 287 .srot_split = 0, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 288 .max_sensors = 11, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 289 }; efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 290 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 41268 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com> To: kbuild-all@lists.01.org Subject: Re: [thermal: thermal/next] thermal/drivers/tsens: Convert msm8960 to reg_field Date: Fri, 16 Apr 2021 04:27:11 +0800 [thread overview] Message-ID: <202104160443.FvPdV3ZA-lkp@intel.com> (raw) In-Reply-To: <161848823868.29796.2378720492280917598.tip-bot2@tip-bot2> [-- Attachment #1: Type: text/plain, Size: 12286 bytes --] Hi thermal-bot, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on v5.12-rc7] [cannot apply to thermal/next next-20210415] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/thermal-bot-for-Ansuel-Smith/thermal-drivers-tsens-Convert-msm8960-to-reg_field/20210415-200542 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7f75285ca572eaabc028cf78c6ab5473d0d160be config: powerpc-randconfig-r022-20210415 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6a18cc23efad410db48a3ccfc233d215de7d4cb9) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install powerpc cross compiling tool for clang build # apt-get install binutils-powerpc-linux-gnu # https://github.com/0day-ci/linux/commit/efea0f0570b6b581bdb2fad978a35fd1a521385b git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review thermal-bot-for-Ansuel-Smith/thermal-drivers-tsens-Convert-msm8960-to-reg_field/20210415-200542 git checkout efea0f0570b6b581bdb2fad978a35fd1a521385b # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/thermal/qcom/tsens-8960.c:193:29: error: use of undeclared identifier 'S0_STATUS_ADDR' priv->sensor[i].status = S0_STATUS_ADDR + 40; ^ >> drivers/thermal/qcom/tsens-8960.c:284:15: error: use of undeclared identifier 'VER_0' .ver_major = VER_0, ^ 2 errors generated. vim +/S0_STATUS_ADDR +193 drivers/thermal/qcom/tsens-8960.c 20d4fd84bf524ad Rajendra Nayak 2016-05-05 175 69b628ac71f07d6 Amit Kucheria 2019-03-20 176 static int init_8960(struct tsens_priv *priv) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 177 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 178 int ret, i; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 179 u32 reg_cntl; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 180 69b628ac71f07d6 Amit Kucheria 2019-03-20 181 priv->tm_map = dev_get_regmap(priv->dev, NULL); 69b628ac71f07d6 Amit Kucheria 2019-03-20 182 if (!priv->tm_map) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 183 return -ENODEV; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 184 20d4fd84bf524ad Rajendra Nayak 2016-05-05 185 /* 20d4fd84bf524ad Rajendra Nayak 2016-05-05 186 * The status registers for each sensor are discontiguous 20d4fd84bf524ad Rajendra Nayak 2016-05-05 187 * because some SoCs have 5 sensors while others have more 20d4fd84bf524ad Rajendra Nayak 2016-05-05 188 * but the control registers stay in the same place, i.e 20d4fd84bf524ad Rajendra Nayak 2016-05-05 189 * directly after the first 5 status registers. 20d4fd84bf524ad Rajendra Nayak 2016-05-05 190 */ 69b628ac71f07d6 Amit Kucheria 2019-03-20 191 for (i = 0; i < priv->num_sensors; i++) { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 192 if (i >= 5) 69b628ac71f07d6 Amit Kucheria 2019-03-20 @193 priv->sensor[i].status = S0_STATUS_ADDR + 40; 69b628ac71f07d6 Amit Kucheria 2019-03-20 194 priv->sensor[i].status += i * 4; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 195 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 196 20d4fd84bf524ad Rajendra Nayak 2016-05-05 197 reg_cntl = SW_RST; 69b628ac71f07d6 Amit Kucheria 2019-03-20 198 ret = regmap_update_bits(priv->tm_map, CNTL_ADDR, SW_RST, reg_cntl); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 199 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 200 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 201 69b628ac71f07d6 Amit Kucheria 2019-03-20 202 if (priv->num_sensors > 1) { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 203 reg_cntl |= SLP_CLK_ENA | (MEASURE_PERIOD << 18); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 204 reg_cntl &= ~SW_RST; 69b628ac71f07d6 Amit Kucheria 2019-03-20 205 ret = regmap_update_bits(priv->tm_map, CONFIG_ADDR, 20d4fd84bf524ad Rajendra Nayak 2016-05-05 206 CONFIG_MASK, CONFIG); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 207 } else { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 208 reg_cntl |= SLP_CLK_ENA_8660 | (MEASURE_PERIOD << 16); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 209 reg_cntl &= ~CONFIG_MASK_8660; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 210 reg_cntl |= CONFIG_8660 << CONFIG_SHIFT_8660; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 211 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 212 69b628ac71f07d6 Amit Kucheria 2019-03-20 213 reg_cntl |= GENMASK(priv->num_sensors - 1, 0) << SENSOR0_SHIFT; 69b628ac71f07d6 Amit Kucheria 2019-03-20 214 ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 215 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 216 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 217 20d4fd84bf524ad Rajendra Nayak 2016-05-05 218 reg_cntl |= EN; 69b628ac71f07d6 Amit Kucheria 2019-03-20 219 ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 220 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 221 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 222 20d4fd84bf524ad Rajendra Nayak 2016-05-05 223 return 0; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 224 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 225 69b628ac71f07d6 Amit Kucheria 2019-03-20 226 static int calibrate_8960(struct tsens_priv *priv) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 227 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 228 int i; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 229 char *data; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 230 69b628ac71f07d6 Amit Kucheria 2019-03-20 231 ssize_t num_read = priv->num_sensors; 69b628ac71f07d6 Amit Kucheria 2019-03-20 232 struct tsens_sensor *s = priv->sensor; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 233 69b628ac71f07d6 Amit Kucheria 2019-03-20 234 data = qfprom_read(priv->dev, "calib"); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 235 if (IS_ERR(data)) 69b628ac71f07d6 Amit Kucheria 2019-03-20 236 data = qfprom_read(priv->dev, "calib_backup"); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 237 if (IS_ERR(data)) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 238 return PTR_ERR(data); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 239 20d4fd84bf524ad Rajendra Nayak 2016-05-05 240 for (i = 0; i < num_read; i++, s++) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 241 s->offset = data[i]; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 242 6b8249abb093551 Srinivas Kandagatla 2019-08-23 243 kfree(data); 6b8249abb093551 Srinivas Kandagatla 2019-08-23 244 20d4fd84bf524ad Rajendra Nayak 2016-05-05 245 return 0; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 246 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 247 20d4fd84bf524ad Rajendra Nayak 2016-05-05 248 /* Temperature on y axis and ADC-code on x-axis */ 20d4fd84bf524ad Rajendra Nayak 2016-05-05 249 static inline int code_to_mdegC(u32 adc_code, const struct tsens_sensor *s) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 250 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 251 int slope, offset; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 252 20d4fd84bf524ad Rajendra Nayak 2016-05-05 253 slope = thermal_zone_get_slope(s->tzd); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 254 offset = CAL_MDEGC - slope * s->offset; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 255 20d4fd84bf524ad Rajendra Nayak 2016-05-05 256 return adc_code * slope + offset; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 257 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 258 e604bdd2a7e1087 Amit Kucheria 2020-03-12 259 static int get_temp_8960(const struct tsens_sensor *s, int *temp) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 260 { 20d4fd84bf524ad Rajendra Nayak 2016-05-05 261 int ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 262 u32 code, trdy; 8b71bce407b3f13 Amit Kucheria 2019-11-01 263 struct tsens_priv *priv = s->priv; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 264 unsigned long timeout; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 265 20d4fd84bf524ad Rajendra Nayak 2016-05-05 266 timeout = jiffies + usecs_to_jiffies(TIMEOUT_US); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 267 do { 69b628ac71f07d6 Amit Kucheria 2019-03-20 268 ret = regmap_read(priv->tm_map, INT_STATUS_ADDR, &trdy); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 269 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 270 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 271 if (!(trdy & TRDY_MASK)) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 272 continue; 69b628ac71f07d6 Amit Kucheria 2019-03-20 273 ret = regmap_read(priv->tm_map, s->status, &code); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 274 if (ret) 20d4fd84bf524ad Rajendra Nayak 2016-05-05 275 return ret; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 276 *temp = code_to_mdegC(code, s); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 277 return 0; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 278 } while (time_before(jiffies, timeout)); 20d4fd84bf524ad Rajendra Nayak 2016-05-05 279 20d4fd84bf524ad Rajendra Nayak 2016-05-05 280 return -ETIMEDOUT; 20d4fd84bf524ad Rajendra Nayak 2016-05-05 281 } 20d4fd84bf524ad Rajendra Nayak 2016-05-05 282 efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 283 static struct tsens_features tsens_8960_feat = { efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 @284 .ver_major = VER_0, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 285 .crit_int = 0, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 286 .adc = 1, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 287 .srot_split = 0, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 288 .max_sensors = 11, efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 289 }; efea0f0570b6b58 thermal-bot for Ansuel Smith 2021-04-15 290 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org [-- Attachment #2: config.gz --] [-- Type: application/gzip, Size: 41268 bytes --]
next prev parent reply other threads:[~2021-04-15 20:27 UTC|newest] Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-04 14:48 [PATCH v14 0/9] Add support for ipq8064 tsens Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 1/9] drivers: thermal: tsens: Add VER_0 tsens version Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 2/9] drivers: thermal: tsens: Don't hardcode sensor slope Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 3/9] drivers: thermal: tsens: Convert msm8960 to reg_field Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-15 18:03 ` kernel test robot 2021-04-15 18:03 ` kernel test robot 2021-04-15 18:52 ` Ansuel Smith 2021-04-15 18:52 ` Ansuel Smith 2021-04-19 8:58 ` Daniel Lezcano 2021-04-19 8:58 ` Daniel Lezcano 2021-04-19 12:08 ` Ansuel Smith 2021-04-19 12:08 ` Ansuel Smith 2021-04-20 7:16 ` Daniel Lezcano 2021-04-20 7:16 ` Daniel Lezcano 2021-04-20 11:04 ` Ansuel Smith 2021-04-20 11:04 ` Ansuel Smith 2021-04-20 11:32 ` Daniel Lezcano 2021-04-20 11:32 ` Daniel Lezcano 2021-04-20 18:36 ` Ansuel Smith 2021-04-20 18:36 ` Ansuel Smith 2021-04-15 20:27 ` kernel test robot [this message] 2021-04-15 20:27 ` kernel test robot 2021-04-04 14:48 ` [PATCH v14 4/9] drivers: thermal: tsens: Use init_common for msm8960 Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 5/9] drivers: thermal: tsens: Fix bug in sensor enable " Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 6/9] drivers: thermal: tsens: Replace custom 8960 apis with generic apis Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 7/9] drivers: thermal: tsens: Drop unused define for msm8960 Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 8/9] drivers: thermal: tsens: Add support for ipq8064-tsens Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith 2021-04-04 14:48 ` [PATCH v14 9/9] dt-bindings: thermal: tsens: Document ipq8064 bindings Ansuel Smith 2021-04-15 12:03 ` [thermal: thermal/next] " thermal-bot for Ansuel Smith 2021-04-05 22:57 ` [PATCH v14 0/9] Add support for ipq8064 tsens Daniel Lezcano 2021-04-20 18:33 [thermal PATCH v15 2/9] drivers: thermal: tsens: Convert msm8960 to reg_field Ansuel Smith 2021-04-27 19:44 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Ansuel Smith
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=202104160443.FvPdV3ZA-lkp@intel.com \ --to=lkp@intel.com \ --cc=amitk@kernel.org \ --cc=ansuelsmth@gmail.com \ --cc=clang-built-linux@googlegroups.com \ --cc=daniel.lezcano@linaro.org \ --cc=kbuild-all@lists.01.org \ --cc=linux-pm@vger.kernel.org \ --cc=rui.zhang@intel.com \ --cc=thara.gopinath@linaro.org \ --cc=tip-bot2@linutronix.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.