msm8974-thermistor.c 19 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  1. /*
  2. * msm8974-thermistor.c - thermistor of H-F Project
  3. *
  4. * Copyright (C) 2011 Samsung Electrnoics
  5. * SangYoung Son <hello.son@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <mach/msm8974-thermistor.h>
  22. #include <mach/sec_thermistor.h>
  23. #ifdef CONFIG_SEC_THERMISTOR
  24. /*Below adc table is same as batt_temp_adc table*/
  25. /* mismatch 8974 */
  26. #if defined(CONFIG_MACH_KS01SKT) || defined(CONFIG_MACH_KS01KTT) || defined(CONFIG_MACH_KS01LGT) || defined(CONFIG_MACH_JACTIVESKT)
  27. static struct sec_therm_adc_table temper_table_ap[] = {
  28. {25794, 900},
  29. {25864, 890},
  30. {26000, 880},
  31. {26155, 870},
  32. {26203, 860},
  33. {26237, 850},
  34. {26288, 840},
  35. {26354, 830},
  36. {26393, 820},
  37. {26472, 810},
  38. {26494, 800},
  39. {26578, 790},
  40. {26636, 780},
  41. {26695, 770},
  42. {26779, 760},
  43. {26817, 750},
  44. {26870, 740},
  45. {27000, 730},
  46. {27031, 720},
  47. {27107, 710},
  48. {27229, 700},
  49. {27271, 690},
  50. {27309, 680},
  51. {27435, 670},
  52. {27534, 660},
  53. {27620, 650},
  54. {27761, 640},
  55. {27834, 630},
  56. {27886, 620},
  57. {27970, 610},
  58. {28106, 600},
  59. {28200, 590},
  60. {28252, 580},
  61. {28339, 570},
  62. {28534, 560},
  63. {28640, 550},
  64. {28794, 540},
  65. {28884, 530},
  66. {28926, 520},
  67. {29091, 510},
  68. {29269, 500},
  69. {29445, 490},
  70. {29620, 480},
  71. {29615, 470},
  72. {29805, 460},
  73. {30015, 450},
  74. {30227, 440},
  75. {30392, 430},
  76. {30567, 420},
  77. {30731, 410},
  78. {30825, 400},
  79. {31060, 390},
  80. {31224, 380},
  81. {31406, 370},
  82. {31595, 360},
  83. {31764, 350},
  84. {31990, 340},
  85. {32111, 330},
  86. {32342, 320},
  87. {32562, 310},
  88. {32705, 300},
  89. {33697, 250},
  90. {34696, 200},
  91. {35682, 150},
  92. {36634, 100},
  93. {37721, 50},
  94. {38541, 0},
  95. {39415, -50},
  96. {40155, -100},
  97. {40730, -150},
  98. {41455, -200},
  99. {41772, -250},
  100. {42149, -300},
  101. };
  102. #elif defined(CONFIG_MACH_HLTESKT) || defined(CONFIG_MACH_HLTEKTT) || \
  103. defined(CONFIG_MACH_HLTELGT) || defined(CONFIG_MACH_HLTEDCM) || defined(CONFIG_MACH_HLTEKDI)
  104. static struct sec_therm_adc_table temper_table_ap[] = {
  105. {26729, 730},
  106. {26784, 720},
  107. {26836, 710},
  108. {26910, 700},
  109. {26976, 690},
  110. {27048, 680},
  111. {27124, 670},
  112. {27227, 660},
  113. {27332, 650},
  114. {27413, 640},
  115. {27522, 630},
  116. {27588, 620},
  117. {27670, 610},
  118. {27835, 600},
  119. {27934, 590},
  120. {28036, 580},
  121. {28125, 570},
  122. {28231, 560},
  123. {28348, 550},
  124. {28463, 540},
  125. {28589, 530},
  126. {28703, 520},
  127. {28830, 510},
  128. {28958, 500},
  129. {29089, 490},
  130. {29212, 480},
  131. {29354, 470},
  132. {29499, 460},
  133. {29648, 450},
  134. {29805, 440},
  135. {29950, 430},
  136. {30109, 420},
  137. {30259, 410},
  138. {30441, 400},
  139. {30600, 390},
  140. {30757, 380},
  141. {30926, 370},
  142. {31077, 360},
  143. {31289, 350},
  144. {31457, 340},
  145. {31663, 330},
  146. {31872, 320},
  147. {32056, 310},
  148. {32292, 300},
  149. {32472, 290},
  150. {32701, 280},
  151. {32915, 270},
  152. {33061, 260},
  153. {33285, 250},
  154. {33468, 240},
  155. {33675, 230},
  156. {33882, 220},
  157. {34092, 210},
  158. {34291, 200},
  159. {34536, 190},
  160. {34725, 180},
  161. {34953, 170},
  162. {35165, 160},
  163. {35348, 150},
  164. {35567, 140},
  165. {35744, 130},
  166. {35997, 120},
  167. {36202, 110},
  168. {36431, 100},
  169. {36649, 90},
  170. {36818, 80},
  171. {37066, 70},
  172. {37222, 60},
  173. {37459, 50},
  174. {37608, 40},
  175. {37841, 30},
  176. {37987, 20},
  177. {38205, 10},
  178. {38416, 0},
  179. {38604, -10},
  180. {38788, -20},
  181. {38959, -30},
  182. {39121, -40},
  183. {39280, -50},
  184. {39431, -60},
  185. {39591, -70},
  186. {39748, -80},
  187. {39895, -90},
  188. {40043, -100},
  189. {40172, -110},
  190. {40307, -120},
  191. {40449, -130},
  192. {40565, -140},
  193. {40712, -150},
  194. {40788, -160},
  195. {40932, -170},
  196. {41010, -180},
  197. {41135, -190},
  198. {41225, -200},
  199. };
  200. #elif defined(CONFIG_MACH_FRESCOLTESKT) || defined(CONFIG_MACH_FRESCOLTEKTT) || \
  201. defined(CONFIG_MACH_FRESCOLTELGT)
  202. static struct sec_therm_adc_table temper_table_ap[] = {
  203. {26699, 730},
  204. {26751, 720},
  205. {26805, 710},
  206. {26880, 700},
  207. {26935, 690},
  208. {27010, 680},
  209. {27101, 670},
  210. {27200, 660},
  211. {27302, 650},
  212. {27383, 640},
  213. {27502, 630},
  214. {27558, 620},
  215. {27630, 610},
  216. {27801, 600},
  217. {27885, 590},
  218. {27988, 580},
  219. {28078, 570},
  220. {28190, 560},
  221. {28314, 550},
  222. {28426, 540},
  223. {28539, 530},
  224. {28666, 520},
  225. {28791, 510},
  226. {28901, 500},
  227. {29049, 490},
  228. {29194, 480},
  229. {29324, 470},
  230. {29475, 460},
  231. {29624, 450},
  232. {29772, 440},
  233. {29930, 430},
  234. {30073, 420},
  235. {30233, 410},
  236. {30400, 400},
  237. {30554, 390},
  238. {30761, 380},
  239. {30930, 370},
  240. {31104, 360},
  241. {31287, 350},
  242. {31473, 340},
  243. {31633, 330},
  244. {31806, 320},
  245. {31984, 310},
  246. {32178, 300},
  247. {32369, 290},
  248. {32569, 280},
  249. {32776, 270},
  250. {32979, 260},
  251. {33191, 250},
  252. {33401, 240},
  253. {33606, 230},
  254. {33819, 220},
  255. {34046, 210},
  256. {34270, 200},
  257. {34480, 190},
  258. {34722, 180},
  259. {34936, 170},
  260. {35144, 160},
  261. {35378, 150},
  262. {35594, 140},
  263. {35800, 130},
  264. {36033, 120},
  265. {36242, 110},
  266. {36448, 100},
  267. {36670, 90},
  268. {36882, 80},
  269. {37082, 70},
  270. {37292, 60},
  271. {37490, 50},
  272. {37678, 40},
  273. {37874, 30},
  274. {38068, 20},
  275. {38238, 10},
  276. {38430, 0},
  277. {38512, -10},
  278. {38639, -20},
  279. {38832, -30},
  280. {38995, -40},
  281. {39177, -50},
  282. {39345, -60},
  283. {39502, -70},
  284. {39650, -80},
  285. {39802, -90},
  286. {39948, -100},
  287. {40091, -110},
  288. {40211, -120},
  289. {40356, -130},
  290. {40483, -140},
  291. {40645, -150},
  292. {40751, -160},
  293. {40902, -170},
  294. {40990, -180},
  295. {41105, -190},
  296. {41195, -200},
  297. };
  298. #elif defined(CONFIG_SEC_F_PROJECT)
  299. static struct sec_therm_adc_table temper_table_ap[] = {
  300. {25749, 900},
  301. {25773, 890},
  302. {25819, 880},
  303. {25873, 870},
  304. {25910, 860},
  305. {25957, 850},
  306. {25993, 840},
  307. {26045, 830},
  308. {26102, 820},
  309. {26157, 810},
  310. {26169, 800},
  311. {26224, 790},
  312. {26297, 780},
  313. {26341, 770},
  314. {26409, 760},
  315. {26464, 750},
  316. {26532, 740},
  317. {26599, 730},
  318. {26658, 720},
  319. {26712, 710},
  320. {26809, 700},
  321. {26862, 690},
  322. {26943, 680},
  323. {27026, 670},
  324. {27094, 660},
  325. {27211, 650},
  326. {27294, 640},
  327. {27405, 630},
  328. {27487, 620},
  329. {27581, 610},
  330. {27672, 600},
  331. {27769, 590},
  332. {27881, 580},
  333. {28004, 570},
  334. {28109, 560},
  335. {28214, 550},
  336. {28327, 540},
  337. {28448, 530},
  338. {28585, 520},
  339. {28692, 510},
  340. {28815, 500},
  341. {28955, 490},
  342. {29093, 480},
  343. {29250, 470},
  344. {29381, 460},
  345. {29533, 450},
  346. {29670, 440},
  347. {29830, 430},
  348. {29981, 420},
  349. {30182, 410},
  350. {30322, 400},
  351. {30464, 390},
  352. {30632, 380},
  353. {30870, 370},
  354. {31001, 360},
  355. {31210, 350},
  356. {31366, 340},
  357. {31624, 330},
  358. {31748, 320},
  359. {31958, 310},
  360. {32167, 300},
  361. {32374, 290},
  362. {32547, 280},
  363. {32754, 270},
  364. {32958, 260},
  365. {33131, 250},
  366. {33395, 240},
  367. {33600, 230},
  368. {33798, 220},
  369. {34007, 210},
  370. {34230, 200},
  371. {34480, 190},
  372. {34730, 180},
  373. {34839, 170},
  374. {35122, 160},
  375. {35324, 150},
  376. {35509, 140},
  377. {35769, 130},
  378. {35925, 120},
  379. {36148, 110},
  380. {36424, 100},
  381. {36561, 90},
  382. {36850, 80},
  383. {37021, 70},
  384. {37180, 60},
  385. {37397, 50},
  386. {37598, 40},
  387. {37787, 30},
  388. {37961, 20},
  389. {38167, 10},
  390. {38349, 0},
  391. {38381, -10},
  392. {38466, -20},
  393. {38604, -30},
  394. {38805, -40},
  395. {38949, -50},
  396. {39161, -60},
  397. {39302, -70},
  398. {39490, -80},
  399. {39615, -90},
  400. {39811, -100},
  401. {39918, -110},
  402. {40072, -120},
  403. {40211, -130},
  404. {40322, -140},
  405. {40453, -150},
  406. {40577, -160},
  407. {40696, -170},
  408. {40801, -180},
  409. {40934, -190},
  410. {41024, -200},
  411. };
  412. #elif defined(CONFIG_SEC_K_PROJECT) || \
  413. defined(CONFIG_SEC_KACTIVE_PROJECT) || defined(CONFIG_SEC_KSPORTS_PROJECT) || \
  414. defined(CONFIG_SEC_S_PROJECT)
  415. static struct sec_therm_adc_table temper_table_ap[] = {
  416. {25954, 900},
  417. {26005, 890},
  418. {26052, 880},
  419. {26105, 870},
  420. {26151, 860},
  421. {26207, 850},
  422. {26253, 840},
  423. {26302, 830},
  424. {26354, 820},
  425. {26405, 810},
  426. {26454, 800},
  427. {26503, 790},
  428. {26554, 780},
  429. {26602, 770},
  430. {26657, 760},
  431. {26691, 750},
  432. {26757, 740},
  433. {26823, 730},
  434. {26889, 720},
  435. {26955, 710},
  436. {27020, 700},
  437. {27081, 690},
  438. {27142, 680},
  439. {27203, 670},
  440. {27264, 660},
  441. {27327, 650},
  442. {27442, 640},
  443. {27557, 630},
  444. {27672, 620},
  445. {27787, 610},
  446. {27902, 600},
  447. {28004, 590},
  448. {28106, 580},
  449. {28208, 570},
  450. {28310, 560},
  451. {28415, 550},
  452. {28608, 540},
  453. {28801, 530},
  454. {28995, 520},
  455. {28944, 510},
  456. {28893, 500},
  457. {29148, 490},
  458. {29347, 480},
  459. {29546, 470},
  460. {29746, 460},
  461. {29911, 450},
  462. {30076, 440},
  463. {30242, 430},
  464. {30490, 420},
  465. {30738, 410},
  466. {30986, 400},
  467. {31101, 390},
  468. {31216, 380},
  469. {31331, 370},
  470. {31446, 360},
  471. {31561, 350},
  472. {31768, 340},
  473. {31975, 330},
  474. {32182, 320},
  475. {32389, 310},
  476. {32596, 300},
  477. {32962, 290},
  478. {32974, 280},
  479. {32986, 270},
  480. {33744, 260},
  481. {33971, 250},
  482. {34187, 240},
  483. {34403, 230},
  484. {34620, 220},
  485. {34836, 210},
  486. {35052, 200},
  487. {35261, 190},
  488. {35470, 180},
  489. {35679, 170},
  490. {35888, 160},
  491. {36098, 150},
  492. {36317, 140},
  493. {36537, 130},
  494. {36756, 120},
  495. {36976, 110},
  496. {37195, 100},
  497. {37413, 90},
  498. {37630, 80},
  499. {37848, 70},
  500. {38065, 60},
  501. {38282, 50},
  502. {38458, 40},
  503. {38635, 30},
  504. {38811, 20},
  505. {38987, 10},
  506. {39163, 0},
  507. {39317, -10},
  508. {39470, -20},
  509. {39624, -30},
  510. {39777, -40},
  511. {39931, -50},
  512. {40065, -60},
  513. {40199, -70},
  514. {40333, -80},
  515. {40467, -90},
  516. {40601, -100},
  517. {40728, -110},
  518. {40856, -120},
  519. {40983, -130},
  520. {41110, -140},
  521. {41237, -150},
  522. {41307, -160},
  523. {41378, -170},
  524. {41448, -180},
  525. {41518, -190},
  526. {41588, -200},
  527. };
  528. #elif defined(CONFIG_SEC_PATEK_PROJECT)
  529. static struct sec_therm_adc_table temper_table_ap[] = {
  530. {25943, 900},
  531. {26002, 890},
  532. {26061, 880},
  533. {26121, 870},
  534. {26181, 860},
  535. {26242, 850},
  536. {26277, 840},
  537. {26313, 830},
  538. {26348, 820},
  539. {26384, 810},
  540. {26420, 800},
  541. {26467, 790},
  542. {26514, 780},
  543. {26562, 770},
  544. {26609, 760},
  545. {26657, 750},
  546. {26728, 740},
  547. {26800, 730},
  548. {26872, 720},
  549. {26944, 710},
  550. {27016, 700},
  551. {27092, 690},
  552. {27168, 680},
  553. {27244, 670},
  554. {27320, 660},
  555. {27396, 650},
  556. {27499, 640},
  557. {27602, 630},
  558. {27705, 620},
  559. {27808, 610},
  560. {27911, 600},
  561. {28058, 590},
  562. {28205, 580},
  563. {28352, 570},
  564. {28499, 560},
  565. {28647, 550},
  566. {28826, 540},
  567. {29005, 530},
  568. {29185, 520},
  569. {29364, 510},
  570. {29544, 500},
  571. {29631, 490},
  572. {29718, 480},
  573. {29805, 470},
  574. {29892, 460},
  575. {29979, 450},
  576. {30179, 440},
  577. {30381, 430},
  578. {30583, 420},
  579. {30785, 410},
  580. {30989, 400},
  581. {31112, 390},
  582. {31236, 380},
  583. {31359, 370},
  584. {31483, 360},
  585. {31607, 350},
  586. {31804, 340},
  587. {32002, 330},
  588. {32199, 320},
  589. {32397, 310},
  590. {32595, 300},
  591. {32783, 290},
  592. {32971, 280},
  593. {33159, 270},
  594. {33347, 260},
  595. {33536, 250},
  596. {33747, 240},
  597. {33958, 230},
  598. {34170, 220},
  599. {34381, 210},
  600. {34593, 200},
  601. {34803, 190},
  602. {35014, 180},
  603. {35224, 170},
  604. {35435, 160},
  605. {35646, 150},
  606. {35859, 140},
  607. {36072, 130},
  608. {36285, 120},
  609. {36498, 110},
  610. {36712, 100},
  611. {36906, 90},
  612. {37101, 80},
  613. {37296, 70},
  614. {37491, 60},
  615. {37686, 50},
  616. {37815, 40},
  617. {37945, 30},
  618. {38074, 20},
  619. {38204, 10},
  620. {38334, 0},
  621. {38506, -10},
  622. {38678, -20},
  623. {28850, -30},
  624. {39022, -40},
  625. {39194, -50},
  626. {39342, -60},
  627. {39490, -70},
  628. {39638, -80},
  629. {39786, -90},
  630. {39935, -100},
  631. {40072, -110},
  632. {40209, -120},
  633. {40347, -130},
  634. {40484, -140},
  635. {40622, -150},
  636. {40730, -160},
  637. {40838, -170},
  638. {40946, -180},
  639. {41054, -190},
  640. {41163, -200},
  641. };
  642. #elif defined(CONFIG_MACH_CHAGALL_LTE) || defined(CONFIG_MACH_KLIMT_LTE)
  643. static struct sec_therm_adc_table temper_table_ap[] = {
  644. {25765, 900},
  645. {25836, 890},
  646. {25907, 880},
  647. {25978, 870},
  648. {26049, 860},
  649. {26120, 850},
  650. {26191, 840},
  651. {26262, 830},
  652. {26333, 820},
  653. {26404, 810},
  654. {26475, 800},
  655. {26549, 790},
  656. {26620, 780},
  657. {26691, 770},
  658. {26762, 760},
  659. {26833, 750},
  660. {26904, 740},
  661. {26975, 730},
  662. {27046, 720},
  663. {27117, 710},
  664. {27188, 700},
  665. {27271, 690},
  666. {27355, 680},
  667. {27438, 670},
  668. {27522, 660},
  669. {27605, 650},
  670. {27721, 640},
  671. {27836, 630},
  672. {27952, 620},
  673. {28067, 610},
  674. {28182, 600},
  675. {28296, 590},
  676. {28409, 580},
  677. {28522, 570},
  678. {28635, 560},
  679. {28748, 550},
  680. {28852, 540},
  681. {28955, 530},
  682. {29058, 520},
  683. {29161, 510},
  684. {29290, 500},
  685. {29410, 490},
  686. {29555, 480},
  687. {29700, 470},
  688. {29845, 460},
  689. {29990, 450},
  690. {30188, 440},
  691. {30386, 430},
  692. {30584, 420},
  693. {30782, 410},
  694. {30981, 400},
  695. {31164, 390},
  696. {31347, 380},
  697. {31530, 370},
  698. {31713, 360},
  699. {31896, 350},
  700. {32081, 340},
  701. {32266, 330},
  702. {32450, 320},
  703. {32635, 310},
  704. {32820, 300},
  705. {33047, 290},
  706. {33274, 280},
  707. {33502, 270},
  708. {33729, 260},
  709. {33956, 250},
  710. {34172, 240},
  711. {34388, 230},
  712. {34605, 220},
  713. {34821, 210},
  714. {35037, 200},
  715. {35246, 190},
  716. {35455, 180},
  717. {35664, 170},
  718. {35873, 160},
  719. {36083, 150},
  720. {36302, 140},
  721. {36522, 130},
  722. {36741, 120},
  723. {36961, 110},
  724. {37180, 100},
  725. {37398, 90},
  726. {37615, 80},
  727. {37833, 70},
  728. {38050, 60},
  729. {38267, 50},
  730. {38443, 40},
  731. {38620, 30},
  732. {38796, 20},
  733. {38972, 10},
  734. {39148, 0},
  735. {39302, -10},
  736. {39455, -20},
  737. {39609, -30},
  738. {39762, -40},
  739. {39916, -50},
  740. {40050, -60},
  741. {40184, -70},
  742. {40318, -80},
  743. {40452, -90},
  744. {40586, -100},
  745. {40713, -110},
  746. {40841, -120},
  747. {40968, -130},
  748. {41095, -140},
  749. {41222, -150},
  750. {41292, -160},
  751. {41363, -170},
  752. {41433, -180},
  753. {41503, -190},
  754. {41573, -200},
  755. };
  756. #else
  757. static struct sec_therm_adc_table temper_table_ap[] = {
  758. {27188, 700},
  759. {27271, 690},
  760. {27355, 680},
  761. {27438, 670},
  762. {27522, 660},
  763. {27605, 650},
  764. {27721, 640},
  765. {27836, 630},
  766. {27952, 620},
  767. {28067, 610},
  768. {28182, 600},
  769. {28296, 590},
  770. {28409, 580},
  771. {28522, 570},
  772. {28635, 560},
  773. {28748, 550},
  774. {28852, 540},
  775. {28955, 530},
  776. {29058, 520},
  777. {29161, 510},
  778. {29290, 500},
  779. {29410, 490},
  780. {29555, 480},
  781. {29700, 470},
  782. {29845, 460},
  783. {29990, 450},
  784. {30188, 440},
  785. {30386, 430},
  786. {30584, 420},
  787. {30782, 410},
  788. {30981, 400},
  789. {31164, 390},
  790. {31347, 380},
  791. {31530, 370},
  792. {31713, 360},
  793. {31896, 350},
  794. {32081, 340},
  795. {32266, 330},
  796. {32450, 320},
  797. {32635, 310},
  798. {32820, 300},
  799. {33047, 290},
  800. {33274, 280},
  801. {33502, 270},
  802. {33729, 260},
  803. {33956, 250},
  804. {34172, 240},
  805. {34388, 230},
  806. {34605, 220},
  807. {34821, 210},
  808. {35037, 200},
  809. {35246, 190},
  810. {35455, 180},
  811. {35664, 170},
  812. {35873, 160},
  813. {36083, 150},
  814. {36302, 140},
  815. {36522, 130},
  816. {36741, 120},
  817. {36961, 110},
  818. {37180, 100},
  819. {37398, 90},
  820. {37615, 80},
  821. {37833, 70},
  822. {38050, 60},
  823. {38267, 50},
  824. {38443, 40},
  825. {38620, 30},
  826. {38796, 20},
  827. {38972, 10},
  828. {39148, 0},
  829. {39302, -10},
  830. {39455, -20},
  831. {39609, -30},
  832. {39762, -40},
  833. {39916, -50},
  834. {40050, -60},
  835. {40184, -70},
  836. {40318, -80},
  837. {40452, -90},
  838. {40586, -100},
  839. {40713, -110},
  840. {40841, -120},
  841. {40968, -130},
  842. {41095, -140},
  843. {41222, -150},
  844. {41292, -160},
  845. {41363, -170},
  846. {41433, -180},
  847. {41503, -190},
  848. {41573, -200},
  849. };
  850. #endif
  851. #if defined(CONFIG_MACH_HLTEDCM) || defined(CONFIG_MACH_HLTEKDI)
  852. static struct sec_therm_adc_table temper_table_flash[] = {
  853. {26135, 850},
  854. {26159, 840},
  855. {26199, 830},
  856. {26241, 820},
  857. {26293, 810},
  858. {26351, 800},
  859. {26391, 790},
  860. {26439, 780},
  861. {26483, 770},
  862. {26536, 760},
  863. {26599, 750},
  864. {26639, 740},
  865. {26729, 730},
  866. {26786, 720},
  867. {26846, 710},
  868. {26915, 700},
  869. {26978, 690},
  870. {27048, 680},
  871. {27134, 670},
  872. {27225, 660},
  873. {27301, 650},
  874. {27412, 640},
  875. {27467, 630},
  876. {27591, 620},
  877. {27679, 610},
  878. {27779, 600},
  879. {27879, 590},
  880. {27982, 580},
  881. {28087, 570},
  882. {28209, 560},
  883. {28345, 550},
  884. {28461, 540},
  885. {28574, 530},
  886. {28702, 520},
  887. {28830, 510},
  888. {28951, 500},
  889. {29098, 490},
  890. {29243, 480},
  891. {29384, 470},
  892. {29542, 460},
  893. {29680, 450},
  894. {29832, 440},
  895. {29996, 430},
  896. {30153, 420},
  897. {30312, 410},
  898. {30477, 400},
  899. {30630, 390},
  900. {30799, 380},
  901. {30961, 370},
  902. {31104, 360},
  903. {31273, 350},
  904. {31455, 340},
  905. {31643, 330},
  906. {31828, 320},
  907. {32024, 310},
  908. {32230, 300},
  909. {32425, 290},
  910. {32638, 280},
  911. {32836, 270},
  912. {33088, 260},
  913. {33302, 250},
  914. {33523, 240},
  915. {33732, 230},
  916. {33947, 220},
  917. {34178, 210},
  918. {34397, 200},
  919. {34627, 190},
  920. {34855, 180},
  921. {35087, 170},
  922. {35282, 160},
  923. {35500, 150},
  924. {35715, 140},
  925. {35924, 130},
  926. {36129, 120},
  927. {36351, 110},
  928. {36553, 100},
  929. {36750, 90},
  930. {36954, 80},
  931. {37121, 70},
  932. {37304, 60},
  933. {37501, 50},
  934. {37703, 40},
  935. {37895, 30},
  936. {38090, 20},
  937. {38228, 10},
  938. {38326, 0},
  939. {38411, -10},
  940. {38508, -20},
  941. {38683, -30},
  942. {38894, -40},
  943. {39082, -50},
  944. {39242, -60},
  945. {39393, -70},
  946. {39540, -80},
  947. {39706, -90},
  948. {39868, -100},
  949. {40012, -110},
  950. {40167, -120},
  951. {40311, -130},
  952. {40437, -140},
  953. {40565, -150},
  954. {40693, -160},
  955. {40821, -170},
  956. {40941, -180},
  957. {41052, -190},
  958. {41154, -200},
  959. };
  960. #endif
  961. static int get_msm8974_siop_level(int temp)
  962. {
  963. static int prev_temp = 400;
  964. static int prev_level;
  965. int level = -1;
  966. #if defined(CONFIG_MACH_HLTEDCM) || defined(CONFIG_MACH_HLTEKDI) || defined(CONFIG_MACH_JS01LTEDCM)
  967. /* This is only for JPN JF-DCM model, currently the SIOP is not using this function.
  968. However, the JPN vendor(DoCoMo) wants to implement the Camera APP shutdown
  969. functionality to avoid over-heat damage. For this, only JPN model gives thermistor value
  970. from the driver layer to platform layer. In this routine, the "notify_change_of_temperature()"
  971. function gives thermistor value and also SIOP value together. This SIOP value is invalid information
  972. and could give an effect to SIOP APP. That is why this enforcing return code is added.
  973. */
  974. return -1;
  975. #endif
  976. if (temp > prev_temp) {
  977. if (temp >= 540)
  978. level = 4;
  979. else if (temp >= 530)
  980. level = 3;
  981. else if (temp >= 480)
  982. level = 2;
  983. else if (temp >= 440)
  984. level = 1;
  985. else
  986. level = 0;
  987. } else {
  988. if (temp < 410)
  989. level = 0;
  990. else if (temp < 440)
  991. level = 1;
  992. else if (temp < 480)
  993. level = 2;
  994. else if (temp < 530)
  995. level = 3;
  996. else
  997. level = 4;
  998. if (level > prev_level)
  999. level = prev_level;
  1000. }
  1001. prev_temp = temp;
  1002. prev_level = level;
  1003. return level;
  1004. }
  1005. static struct sec_therm_platform_data sec_therm_pdata = {
  1006. .adc_arr_size = ARRAY_SIZE(temper_table_ap),
  1007. .adc_table = temper_table_ap,
  1008. .polling_interval = 30 * 1000, /* msecs */
  1009. .get_siop_level = get_msm8974_siop_level,
  1010. #if defined(CONFIG_MACH_HLTEDCM) || defined(CONFIG_MACH_HLTEKDI) || \
  1011. defined(CONFIG_MACH_JS01LTEDCM) || defined(CONFIG_MACH_KLTE_JPN) || \
  1012. defined(CONFIG_MACH_KACTIVELTE_DCM) || defined(CONFIG_MACH_KLIMT_LTE_DCM)
  1013. #if defined(CONFIG_MACH_HLTEDCM) || defined(CONFIG_MACH_HLTEKDI)
  1014. .adc_flash_arr_size = ARRAY_SIZE(temper_table_flash),
  1015. .adc_table_flash = temper_table_flash,
  1016. #endif
  1017. .no_polling = 0,
  1018. #else
  1019. .no_polling = 1,
  1020. #endif
  1021. };
  1022. struct platform_device sec_device_thermistor = {
  1023. .name = "sec-thermistor",
  1024. .id = -1,
  1025. .dev.platform_data = &sec_therm_pdata,
  1026. };
  1027. #endif