Commit Graph

12 Commits

Author SHA1 Message Date
Vic Yang
23d9defb2b Disable thermal thresholds for TMP006 sensor near CPU
This sensor doesn't provide accurate case temperature. Let's
disable thermal thresholds for the object tempearture reading from this
sensor.

BUG=chrome-os-partner:9599
TEST=Build success. System works fine.

Change-Id: I9408de59a3349f944c5e215085da93f23965ebc9
Reviewed-on: https://gerrit.chromium.org/gerrit/25824
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2012-06-22 11:12:43 -07:00
Vic Yang
3367d02f1f Add option to adjust delay for indiviual temperature sensor
Perviously we have a 10-second delay for all temperature sensor. This is
not suitable for CPU temperature. Let's change that to have an option to
set the delay length for each temperature sensor. And also shorten the
delay of TMP006 sensor to 7 seconds, that of EC internal temperature to
4 seconds, and that of PECI CPU temperature to 0 second.

Signed-off-by: Vic Yang <victoryang@chromium.org>

BUG=chrome-os-partner:10233
TEST=Check EC issued warning as soon as CPU temperature reached the
threshold.

(cherry picked from commit cf24df7f3ee24eaa5dbeae3b304d11ddada9a914)

Change-Id: Id2cc4a437bde15697afe4020b6153e5d13466759
Reviewed-on: https://gerrit.chromium.org/gerrit/24694
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Vic Yang <victoryang@chromium.org>
2012-06-08 08:57:35 -07:00
Randall Spangler
ee3edc0116 Clean up inits
We can clear the reset cause in system pre-init now because of a
previous change which preserves it across a sysjump.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=if it boots, it works

Change-Id: I1d8b99df5a0be0de9545d22ad1a6b7fb3140f813
2012-04-19 11:08:28 -07:00
Vic Yang
9f8e8dc6a3 Temperature sensor grouping.
Group temperature sensors into different types so we only have to set
temperature threshold for each type instead of each sensor.

Signed-off-by: Vic Yang <victoryang@google.com>

BUG=chrome-os-partner:8466
TEST=Fan control still works.

Change-Id: I7acc714c32f282cec490b9e02d402ab91a53becf
2012-03-16 10:40:52 +08:00
Vic Yang
d2fbdfbc67 Temp sensor report 0xfd on sensor unpowered.
Make temp sensor report 0xfd when sensor is unpowered.
Also refactor power specification of temp sensors from thermal.c to
temp_sensor.c.

Signed-off-by: Vic Yang <victoryang@google.com>

BUG=chrome-os-partner:8279
TEST=none

Change-Id: Ib13813bdbac2f048fbc3b98fae5bbf104ebf37d7
2012-03-14 13:32:02 +08:00
Vic Yang
0fefd25c0c Temperature polling and temporal correction
A temperature polling task is added to achieve temporal correction and
also reduce the latency of reading temperature.

Factor out sensor specific part to keep code clean.

Signed-off-by: Vic Yang <victoryang@chromium.org>

BUG=chrome-os-partner:7801
TEST=On link, 'temps' shows all temperature readings.
Cover each sensor with hand and see object temperature rise.
Compilation succeeded on bds/adv/daisy/discovery.

Change-Id: I3c44c8b2e3ab2aa9ce640d3fc25e7fba56534b86
2012-02-18 13:37:53 +08:00
Randall Spangler
6b8e8be703 Fix discovery and bds builds, which don't have temp sensor or peci
Remove id field from temp_sensor_t struct, since it's only used by the
console command (which already knows the id, because it's looping over
it).

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST='temps'

Change-Id: I0970850073d644509cd5501d7ac4421c7373143b
2012-02-13 10:41:34 -08:00
Vic Yang
059c633a27 Add tmp006 object temperature calculation
Implement TMP006 object temperature calculation. Also add a console
command to calculate temperature with manually entered data.

BUG=chrome-os-partner:7801
TEST=In console, "tempremote 29715 -105000 6390" gives 285.00K.

Change-Id: I0f9193fb970fdc36566399e7083e73ab58965a85
2012-02-08 14:53:17 +08:00
David Hendricks
53c1c20fb8 Additional compilation fix-ups for non-LM4 targets
- Add #ifdef CONFIG_TEMP_SENSOR before #include'ing temp_sensor.h
  which actually requires temp_sensor_id to be defined.
  Revert the forward declare used earlier since it is not the
  correct solution in this case.
- Add #ifdef CONFIG_CHARGER before calling charger_init()

Signed-off-by: David Hendricks <dhendrix@chromium.org>

BUG=None
TEST=compiled on both BDS and Discovery

Change-Id: I60b7e4ba91eb958b3ad724cc9ffa9a12fe9c3a71
2012-02-06 15:40:23 -08:00
David Hendricks
af9532d6fe Add forward declarations in ADC and temp_sensor headers
This is a trivial patch to fix compilation for boards that are not
based on LM4 (e.g. Discovery).

Signed-off-by: David Hendricks <dhendrix@chromium.org>

TEST=Compiled for Discovery
BUG=None

Change-Id: Ia1f29c61ff4a1f65fe65c43a8e58def7d1217ab2
2012-02-06 13:36:19 -08:00
Vic Yang
000a6d5742 Refactor temperature sensor code and add support of Link I2C temp sensor.
Refactor board/chip-specific code into corresponding directories.
Add support of the four I2C temp sensor in Link.
Use table lookup to handle different types of temperature sensors.

BUG=chrome-os-partner:7527
TEST=Correctly read EC internal temperature on bds.
Compile for link succeeded.

Change-Id: I694cfa54e1545798d877fafdf18c5585ab5f03e2
2012-02-04 14:37:04 +08:00
Randall Spangler
bdf7da5b08 Initial sources import 1/3
source files mainly done by Randall.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

Change-Id: Iaff83a842b17f3350fb6f2a3f1597ad4c29bd12a
2011-12-07 19:10:02 +00:00