Add jbt device.
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 4 Apr 2010 19:14:05 +0000 (21:14 +0200)
committerLars-Peter Clausen <lars@metafoo.de>
Mon, 17 May 2010 19:22:11 +0000 (21:22 +0200)
arch/arm/mach-s3c2440/mach-gta02.c

index 431f354..b2c3291 100644 (file)
@@ -99,6 +99,7 @@
 #include <mach/gta02-pm-gps.h>
 #include <mach/gta02-pm-wlan.h>
 
+#include <linux/jbt6k74.h>
 #include <linux/glamofb.h>
 #include <linux/mfd/glamo.h>
 
@@ -303,6 +304,28 @@ static struct glamo_platform_data gta02_glamo_pdata = {
        .glamo_external_reset = gta02_glamo_external_reset,
 };
 
+/* JBT6k74 display controller */
+static void gta02_jbt6k74_probe_completed(struct device *dev)
+ {
+       pcf50633_bl_set_brightness_limit(gta02_pcf, 0x3f);
+}
+const static struct jbt6k74_platform_data jbt6k74_pdata = {
+       .gpio_reset = GTA02_GPIO_GLAMO(4),
+};
+
+static struct spi_board_info gta02_spi_board_info[] = {
+       {
+               .modalias       = "jbt6k74",
+               .platform_data  = &jbt6k74_pdata,
+               .controller_data = (void*)GTA02_GPIO_GLAMO(12),
+               /* irq */
+               .max_speed_hz   = 100 * 1000,
+               .bus_num        = 2,
+               .chip_select = 0
+       },
+};
 static struct resource gta02_glamo_resources[] = {
        [0] = {
                .start  = S3C2410_CS1,
@@ -449,6 +472,11 @@ static struct regulator_consumer_supply ldo5_consumers[] = {
        },
 };
 
+static struct regulator_consumer_supply ldo6_consumers[] = {
+       REGULATOR_SUPPLY("VDC", "spi2.0"),
+       REGULATOR_SUPPLY("VDDIO", "spi2.0"),
+};
+
 static struct regulator_consumer_supply hcldo_consumers[] = {
        {
                .dev = &gta02_glamo_dev.dev,
@@ -578,7 +606,10 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
                                .min_uV = 3000000,
                                .max_uV = 3000000,
                                .valid_modes_mask = REGULATOR_MODE_NORMAL,
+                               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
                        },
+                       .num_consumer_supplies = ARRAY_SIZE(ldo6_consumers),
+                       .consumer_supplies = ldo6_consumers,
                },
                [PCF50633_REGULATOR_MEMLDO] = {
                        .constraints = {
@@ -984,7 +1015,11 @@ static struct gta02_device_children gta02_device_children[] = {
                .dev_name = "reg-fixed-voltage.1",
                .num_children = 1,
                .children = gta02_gsm_supply_children,
-       }
+       },
+       {
+               .dev_name = "spi2.0",
+               .probed_callback = gta02_jbt6k74_probe_completed,
+       },
 };
 
 static int gta02_add_child_devices(struct device *parent,
@@ -1133,10 +1168,10 @@ static void __init gta02_machine_init(void)
        s3c_ohci_set_platdata(&gta02_usb_info);
        s3c_nand_set_platdata(&gta02_nand_info);
        s3c_i2c0_set_platdata(NULL);
-
-       i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
        spi_register_board_info(gta02_spi_board_info,
                                ARRAY_SIZE(gta02_spi_board_info));
+
+       i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
  
        platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));