]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Support for 7-bit backlight register on new Tahvo chips
authorJuha Yrjola <juha.yrjola@nokia.com>
Fri, 9 Dec 2005 15:47:04 +0000 (17:47 +0200)
committerJuha Yrjola <juha.yrjola@nokia.com>
Fri, 9 Dec 2005 15:47:04 +0000 (17:47 +0200)
drivers/cbus/cbus.c
drivers/cbus/tahvo.c

index f814eaac7c010a17e974d86254828c8b9cfd48a4..eff38be50880e9c8a3e2ee28aec88ce7c4730cd0 100644 (file)
@@ -241,6 +241,7 @@ int __init cbus_bus_init(void)
        chost->dat_gpio = cbus_config->dat_gpio;
        chost->sel_gpio = cbus_config->sel_gpio;
 
+#ifdef CONFIG_ARCH_OMAP1
        if (!OMAP_GPIO_IS_MPUIO(chost->clk_gpio) ||
            !OMAP_GPIO_IS_MPUIO(chost->dat_gpio) ||
            !OMAP_GPIO_IS_MPUIO(chost->sel_gpio)) {
@@ -248,6 +249,7 @@ int __init cbus_bus_init(void)
                ret = -ENODEV;
                goto exit1;
        }
+#endif
 
        if ((ret = omap_request_gpio(chost->clk_gpio)) < 0)
                goto exit1;
index f80405cc90eff8187ed3133b94be509880ccd52f..6693a74e303911099a4fed449704dae5306f1c42 100644 (file)
@@ -50,6 +50,7 @@
 
 static int tahvo_initialized;
 static int tahvo_irq_pin;
+static int tahvo_is_betty;
 
 static struct tasklet_struct tahvo_tasklet;
 spinlock_t tahvo_lock = SPIN_LOCK_UNLOCKED;
@@ -268,7 +269,7 @@ void tahvo_free_irq(int id)
 static int __devinit tahvo_probe(struct device *dev)
 {
        const struct omap_em_asic_bb5_config * em_asic_config;
-       int rev, ret;
+       int rev, id, ret;
 
        /* Prepare tasklet */
        tasklet_init(&tahvo_tasklet, tahvo_tasklet_handler, 0);
@@ -283,14 +284,21 @@ static int __devinit tahvo_probe(struct device *dev)
        tahvo_initialized = 1;
 
        rev = tahvo_read_reg(TAHVO_REG_ASICR);
-       if (((rev >> 8) & 0x0f) != 0x03) {
-               printk(KERN_ERR PFX "Tahvo chip not found\n");
+
+       id = (rev >> 8) & 0xff;
+       if (id == 0x03) {
+               if ((rev & 0xff) >= 0x50)
+                       tahvo_7bit_backlight = 1;
+       } else if (id == 0x0b) {
+               tahvo_is_betty = 1;
+               tahvo_7bit_backlight = 1;
+       } else {
+               printk(KERN_ERR "Tahvo/Betty chip not found");
                return -ENODEV;
        }
-       rev &= 0xff;
-       if (rev >= 0x50)
-               tahvo_7bit_backlight = 1;
-       printk(KERN_INFO "Tahvo v%d.%d found\n", rev >> 4, rev & 0x0f);
+
+       printk(KERN_INFO "%s v%d.%d found\n", tahvo_is_betty ? "Betty" : "Tahvo",
+              (rev >> 4) & 0x0f, rev & 0x0f);
 
        tahvo_irq_pin = em_asic_config->tahvo_irq_gpio;
 
@@ -370,7 +378,7 @@ static int __init tahvo_init(void)
 {
        int ret = 0;
 
-       printk(KERN_INFO "Tahvo driver initialising\n");
+       printk(KERN_INFO "Tahvo/Betty driver initialising\n");
 
        init_completion(&device_release);