- cirrus-logic-framebuffer-i2c-support.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Cirrus Logic framebuffer I2C support

has been removed from the -mm tree.  Its filename is

     cirrus-logic-framebuffer-i2c-support.patch

This patch was dropped because it was nacked by the maintainer

------------------------------------------------------
Subject: Cirrus Logic framebuffer I2C support
From: Krzysztof Halasa <khc@xxxxxxxxx>

Add I2C support to Cirrus Logic framebuffer driver.  Only "I2C adapter" is
supported, it's not used for DDC purposes.  Tested with an old Intel R440LX
machine against ST M24512 I2C EEPROM connected to VGA DDC signals.

Currently works with "Alpine" chips only (CL-GD543x and 544x).

Signed-off-by: Krzysztof Halasa <khc@xxxxxxxxx>
Cc: "Antonino A. Daplas" <adaplas@xxxxxxx>
Cc: Jean Delvare <khali@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/video/Kconfig    |    6 +++
 drivers/video/cirrusfb.c |   71 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 76 insertions(+), 1 deletion(-)

diff -puN drivers/video/cirrusfb.c~cirrus-logic-framebuffer-i2c-support drivers/video/cirrusfb.c
--- a/drivers/video/cirrusfb.c~cirrus-logic-framebuffer-i2c-support
+++ a/drivers/video/cirrusfb.c
@@ -46,6 +46,8 @@
 #include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/selection.h>
+#include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 #include <asm/pgtable.h>
 
 #ifdef CONFIG_ZORRO
@@ -404,7 +406,11 @@ struct cirrusfb_info {
 
 	u32	pseudo_palette[16];
 	struct { u8 red, green, blue, pad; } palette[256];
-
+#ifdef CONFIG_FB_CIRRUS_I2C
+	int i2c_used;
+	struct i2c_adapter alpine_ops;
+	struct i2c_algo_bit_data bit_alpine_data;
+#endif
 #ifdef CONFIG_ZORRO
 	struct zorro_dev *zdev;
 #endif
@@ -2295,6 +2301,38 @@ static int cirrusfb_set_fbinfo(struct ci
 	return 0;
 }
 
+#ifdef CONFIG_FB_CIRRUS_I2C
+static void alpine_setsda(void *ptr, int state)
+{
+	struct cirrusfb_info *cinfo = ptr;
+	u8 reg = vga_rseq(cinfo->regbase, 0x08) & ~2;
+	if (state)
+		reg |= 2;
+	vga_wseq(cinfo->regbase, 0x08, reg);
+}
+
+static void alpine_setscl(void *ptr, int state)
+{
+	struct cirrusfb_info *cinfo = ptr;
+	u8 reg = vga_rseq(cinfo->regbase, 0x08) & ~1;
+	if (state)
+		reg |= 1;
+	vga_wseq(cinfo->regbase, 0x08, reg);
+}
+
+static int alpine_getsda(void *ptr)
+{
+	struct cirrusfb_info *cinfo = ptr;
+	return !!(vga_rseq(cinfo->regbase, 0x08) & 0x80);
+}
+
+static int alpine_getscl(void *ptr)
+{
+	struct cirrusfb_info *cinfo = ptr;
+	return !!(vga_rseq(cinfo->regbase, 0x08) & 0x04);
+}
+#endif
+
 static int cirrusfb_register(struct cirrusfb_info *cinfo)
 {
 	struct fb_info *info;
@@ -2334,6 +2372,33 @@ static int cirrusfb_register(struct cirr
 		goto err_dealloc_cmap;
 	}
 
+#ifdef CONFIG_FB_CIRRUS_I2C
+	cinfo->i2c_used = 0;
+	if (cinfo->btype == BT_ALPINE || cinfo->btype == BT_PICASSO4) {
+		vga_wseq(cinfo->regbase, 0x08, 0x41); /* DDC mode: SCL */
+		vga_wseq(cinfo->regbase, 0x08, 0x43); /* DDC mode: SCL + SDA */
+		cinfo->bit_alpine_data.setsda = alpine_setsda;
+		cinfo->bit_alpine_data.setscl = alpine_setscl;
+		cinfo->bit_alpine_data.getsda = alpine_getsda;
+		cinfo->bit_alpine_data.getscl = alpine_getscl;
+		cinfo->bit_alpine_data.udelay = 5;
+		cinfo->bit_alpine_data.mdelay = 1;
+		cinfo->bit_alpine_data.timeout = HZ;
+		cinfo->bit_alpine_data.data = cinfo;
+		cinfo->alpine_ops.owner = THIS_MODULE;
+		cinfo->alpine_ops.id = I2C_HW_B_LP;
+		cinfo->alpine_ops.algo_data = &cinfo->bit_alpine_data;
+		strlcpy(cinfo->alpine_ops.name,
+			"Cirrus Logic Alpine DDC I2C adapter", I2C_NAME_SIZE);
+		if (!(err = i2c_bit_add_bus(&cinfo->alpine_ops))) {
+			printk(KERN_DEBUG "Initialized Alpine I2C adapter\n");
+			cinfo->i2c_used = 1;
+		} else
+			printk(KERN_WARNING "Unable to initialize Alpine I2C"
+			       "adapter (result = %i)\n", err);
+	}
+#endif
+
 	DPRINTK ("EXIT, returning 0\n");
 	return 0;
 
@@ -2349,6 +2414,10 @@ static void __devexit cirrusfb_cleanup (
 	struct cirrusfb_info *cinfo = info->par;
 	DPRINTK ("ENTER\n");
 
+#ifdef CONFIG_FB_CIRRUS_I2C
+	if (cinfo->i2c_used)
+		i2c_bit_del_bus(&cinfo->alpine_ops);
+#endif
 	switch_monitor (cinfo, 0);
 
 	unregister_framebuffer (info);
diff -puN drivers/video/Kconfig~cirrus-logic-framebuffer-i2c-support drivers/video/Kconfig
--- a/drivers/video/Kconfig~cirrus-logic-framebuffer-i2c-support
+++ a/drivers/video/Kconfig
@@ -137,6 +137,12 @@ config FB_CIRRUS
 	  Say N unless you have such a graphics board or plan to get one
 	  before you next recompile the kernel.
 
+config FB_CIRRUS_I2C
+	bool "   Enable I2C adapter driver"
+	depends on FB_CIRRUS
+	help
+	  This enables I2C support for Cirrus Logic boards.
+
 config FB_PM2
 	tristate "Permedia2 support"
 	depends on FB && ((AMIGA && BROKEN) || PCI)
_

Patches currently in -mm which might be from khc@xxxxxxxxx are


-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux