From 0233a9543d99932fa0ff058dbee4e097d84f9730 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Mon, 20 Dec 2010 15:05:52 -0800 Subject: NCT1008 temperature sensor driver Replace the PM-only driver for NCT1008 with a new version written by Varun Wadekar and Dmitriy Gruzman. Add a callback to an alarm function specified in the board platform data. Change-Id: Ib429533930ee75af3402d24b0bc286da9f6ee67b Signed-off-by: Todd Poynor Rebase-Id: R50bf7691d332dd562e3ef125095c7cca7ccc3abf --- include/linux/nct1008.h | 74 ++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 44 deletions(-) (limited to 'include/linux') diff --git a/include/linux/nct1008.h b/include/linux/nct1008.h index c6b396246..d65693507 100644 --- a/include/linux/nct1008.h +++ b/include/linux/nct1008.h @@ -1,54 +1,40 @@ /* - * Copyright (C) 2010 Motorola, Inc. + * include/linux/nct1008.h + * + * NCT1008, temperature monitoring device from ON Semiconductors + * + * Copyright (c) 2010, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - * 02111-1307, USA + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _LINUX_NCT1008_H__ -#define _LINUX_NCT1008_H__ - -/* NCT1008 Read Only Registers */ -#define NCT_LOCAL_TEMP_RD 0x00 -#define NCT_EXT_TEMP_HIGH_RD 0x01 -#define NCT_EXT_TEMP_LOW_RD 0x10 -#define NCT_STATUS_RD 0x02 - -/* NCT1008 Control Registers */ -#define NCT_CONFIG_RD 0x03 -#define NCT_CONFIG_WR 0x09 -#define NCT_CONV_RATE_RD 0x04 -#define NCT_CONV_RATE_WR 0x0A - -/* NCT1008 Limit Registers */ -#define NCT_LOCAL_TEMP_HIGH_LIMIT_RD 0x05 -#define NCT_LOCAL_TEMP_LOW_LIMIT_RD 0x06 -#define NCT_LOCAL_TEMP_HIGH_LIMIT_WR 0x0B -#define NCT_LOCAL_TEMP_LOW_LIMIT_WR 0x0C +#ifndef _LINUX_NCT1008_H +#define _LINUX_NCT1008_H -#define NCT_EXT_TEMP_HIGH_LIMIT_HBYTE_RD 0x07 -#define NCT_EXT_TEMP_LOW_LIMIT_HBYTE_RD 0x08 -#define NCT_EXT_TEMP_HIGH_LIMIT_HBYTE_WR 0x0D -#define NCT_EXT_TEMP_LOW_LIMIT_HBYTE_WR 0x0E -#define NCT_EXT_TEMP_HIGH_LIMIT_LBYTE_RDWR 0x13 -#define NCT_EXT_TEMP_LOW_LIMIT_LBYTE_RDWR 0x14 -#define NCT_EXT_THERM_LIMIT 0x19 -#define NCT_LOCAL_THERM_LIMIT 0x20 +#include -#define NCT_EXT_TEMP_OFFSET_HIGH_RDWR 0x11 -#define NCT_EXT_TEMP_OFFSET_LOW_RDWR 0x12 -#define NCT_THERM_HYST 0x21 -#define NCT_CONSEC_ALERT 0x22 +struct nct1008_platform_data { + bool supported_hwrev; + bool ext_range; + u8 conv_rate; + u8 offset; + u8 hysteresis; + u8 shutdown_ext_limit; + u8 shutdown_local_limit; + u8 throttling_ext_limit; + void (*alarm_fn)(bool raised); +}; -#endif /* _LINUX_NCT1008_H__ */ +#endif /* _LINUX_NCT1008_H */ -- cgit v1.2.2