Skip to contentSkip to conversation

OZ99x I2C button and led support driver

PATCH New akpm-de/[email protected] 1 participant 1 message Feb 5, 2008 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 OZ99x I2C button and led support driver

From: Hendrik Sattler <[email protected]>

This adds new-style I2c device driver for O2 Micro/ETC OZ990 devices. Button support was tested with a ETC OZ992S in a Fujitsu-Siemens C-6637.

Cc Jean Delvare <[email protected]>
Cc Richard Purdie <rpurdie-Fm38FmjxZ/[email protected]>

---

 drivers/i2c/chips/Kconfig  |   12 
 drivers/i2c/chips/Makefile |    1 
 drivers/i2c/chips/oz99x.c  |  705 +++++++++++++++++++++++++++++++++++
 include/linux/oz99x.h      |   31 +
 4 files changed, 749 insertions(+)
drivers/i2c/chips/Kconfig renamed from drivers/i2c/chips/Kconfig~oz99x-i2c-button-and-led-support-driver +12 -0
diff -puN drivers/i2c/chips/Kconfig~oz99x-i2c-button-and-led-support-driver drivers/i2c/chips/Kconfig
@@ -138,4 +138,16 @@ config MENELAUS
 	  and other features that are often used in portable devices like
 	  cell phones and PDAs.
 
+config OZ99X
+	tristate "O2 Micro/ETC OZ990/OZ992 SMBus chip"
+	depends on I2C
+	select INPUT_POLLDEV
+	help
+	  If you say Y here, you get support for the OZ990 and OZ992 chip
+	  from O2 Micro. This driver provides support for buttons and
+	  LEDs according to the preconfigured GPIO setup.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called oz99x.
+
 endmenu
drivers/i2c/chips/Makefile renamed from drivers/i2c/chips/Makefile~oz99x-i2c-button-and-led-support-driver +1 -0
diff -puN drivers/i2c/chips/Makefile~oz99x-i2c-button-and-led-support-driver drivers/i2c/chips/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_om
 obj-$(CONFIG_TPS65010)		+= tps65010.o
 obj-$(CONFIG_MENELAUS)		+= menelaus.o
 obj-$(CONFIG_SENSORS_TSL2550)	+= tsl2550.o
+obj-$(CONFIG_OZ99X)		+= oz99x.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/i2c/chips/oz99x.c new file +705 -0

705 lines not on this page · raw message

include/linux/oz99x.h new file +31 -0
diff -puN /dev/null include/linux/oz99x.h
@@ -0,0 +1,31 @@
+/*
+    oz99x.h - O2 Micro/ETC OZ990/OZ992 driver
+
+    Copyright (C) 2006-2007 Hendrik Sattler <[email protected]>
+
+    This program is free software; you can redistribute it and/or modify
+    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.
+
+    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.
+*/
+
+#define OZ99X_BUTTON_MAX 15
+#define OZ99X_BUTTON_MIN 8
+#define OZ99X_KEYMAP_ENTRIES (OZ99X_BUTTON_MAX-OZ99X_BUTTON_MIN+1)
+
+#define OZ99X_LED_MAX 7
+#define OZ99X_LED_MIN 0
+#define OZ99X_LED_COUNT (OZ99X_LED_MAX-OZ99X_LED_MIN+1)
+
+struct oz99x_platform_data {
+	int keymap[OZ99X_KEYMAP_ENTRIES];
+};

_

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c