Send commitlog mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r1578 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
2. r1579 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
3. r1580 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
4. r1581 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
5. r1582 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
--- Begin Message ---
Author: laforge
Date: 2007-03-30 21:27:27 +0200 (Fri, 30 Mar 2007)
New Revision: 1578
Modified:
trunk/src/target/kernel/patches/gta01-core.patch
Log:
* make use of new pcf50606 platform_data
Modified: trunk/src/target/kernel/patches/gta01-core.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-core.patch 2007-03-30 19:27:11 UTC
(rev 1577)
+++ trunk/src/target/kernel/patches/gta01-core.patch 2007-03-30 19:27:27 UTC
(rev 1578)
@@ -1,10 +1,10 @@
This patch adds support for the FIC GTA01 machine type to the ARM port of
the linux kernel.
-Index: linux-2.6.20.2/arch/arm/mach-s3c2410/Kconfig
+Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig
===================================================================
---- linux-2.6.20.2.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-26
11:31:44.000000000 +0200
-+++ linux-2.6.20.2/arch/arm/mach-s3c2410/Kconfig 2007-03-26
14:24:48.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-30
20:42:20.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-30
20:45:38.000000000 +0200
@@ -86,6 +86,14 @@
help
Say Y here if you are using the Armzone QT2410
@@ -20,10 +20,10 @@
config ARCH_S3C2440
bool "SMDK2440"
select CPU_S3C2440
-Index: linux-2.6.20.2/arch/arm/mach-s3c2410/Makefile
+Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile
===================================================================
---- linux-2.6.20.2.orig/arch/arm/mach-s3c2410/Makefile 2007-03-26
11:31:44.000000000 +0200
-+++ linux-2.6.20.2/arch/arm/mach-s3c2410/Makefile 2007-03-26
11:31:44.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-30
20:42:20.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-30
20:45:37.000000000 +0200
@@ -89,5 +89,6 @@
obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
@@ -31,11 +31,11 @@
+obj-$(CONFIG_MACH_GTA01) += mach-gta01.o
obj-$(CONFIG_MACH_SMDK) += common-smdk.o
-Index: linux-2.6.20.2/arch/arm/mach-s3c2410/mach-gta01.c
+Index: linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.2/arch/arm/mach-s3c2410/mach-gta01.c 2007-03-26
11:35:14.000000000 +0200
-@@ -0,0 +1,507 @@
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c 2007-03-30
20:45:51.000000000 +0200
+@@ -0,0 +1,562 @@
+/*
+ * linux/arch/arm/mach-s3c2410/mach-gta01.c
+ *
@@ -139,9 +139,50 @@
+ },
+};
+
++/* PMU driver info */
++
++static struct pcf50606_platform_data gta01_pcf_pdata = {
++ .used_features = PCF50606_FEAT_EXTON |
++ PCF50606_FEAT_MBC |
++ PCF50606_FEAT_BBC |
++ PCF50606_FEAT_RTC |
++ PCF50606_FEAT_CHGCUR |
++ PCF50606_FEAT_BATVOLT |
++ PCF50606_FEAT_BATTEMP,
++ .onkey_seconds_required = 5,
++ .r_fix_batt = 10000,
++ .r_fix_batt_par = 10000,
++ .r_sense_milli = 220,
++ .rails = {
++ [PCF50606_REGULATOR_DCD] = {
++ .name = "dcd",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ },
++};
++
++static struct resource gta01_pmu_resources[] = {
++ [0] = {
++ .flags = IORESOURCE_IRQ,
++ .start = GTA01_IRQ_PCF50606,
++ .end = GTA01_IRQ_PCF50606,
++ },
++};
++
++struct platform_device gta01_pmu_dev = {
++ .name = "pcf50606",
++ .num_resources = ARRAY_SIZE(gta01_pmu_resources),
++ .resource = gta01_pmu_resources,
++ .dev = {
++ .platform_data = >a01_pcf_pdata,
++ },
++};
++
+/* LCD driver info */
+
-+
+/* Configuration for 480x640 toppoly TD028TTEC1 */
+static struct s3c2410fb_mach_info gta01_lcd_cfg __initdata = {
+ .regs = {
@@ -529,6 +570,20 @@
+ platform_device_register(>a01_button_dev);
+ platform_device_register(>a01_pm_gsm_dev);
+
++ switch (system_rev) {
++ case GTA01v3_SYSTEM_REV:
++ case GTA01v4_SYSTEM_REV:
++ case GTA01Bv2_SYSTEM_REV:
++ case GTA01Bv3_SYSTEM_REV:
++ /* just use the default (GTA01_IRQ_PCF50606) */
++ break;
++ case GTA01Bv4_SYSTEM_REV:
++ gta01_pmu_resources[0].start =
++ gta01_pmu_resources[0].end = GTA01Bv4_IRQ_PCF50606;
++ break;
++ }
++ platform_device_register(>a01_pmu_dev);
++
+ s3c2410_pm_init();
+}
+
@@ -543,10 +598,10 @@
+MACHINE_END
+
+
-Index: linux-2.6.20.2/include/asm-arm/arch-s3c2410/gta01.h
+Index: linux-2.6.20.4/include/asm-arm/arch-s3c2410/gta01.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.2/include/asm-arm/arch-s3c2410/gta01.h 2007-03-26
14:28:16.000000000 +0200
++++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/gta01.h 2007-03-30
20:45:23.000000000 +0200
@@ -0,0 +1,69 @@
+#ifndef _GTA01_H
+#define _GTA01_H
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-30 21:34:41 +0200 (Fri, 30 Mar 2007)
New Revision: 1579
Modified:
trunk/src/target/kernel/patches/gta01-core.patch
Log:
* enable WDT feature of PCF50606
Modified: trunk/src/target/kernel/patches/gta01-core.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-core.patch 2007-03-30 19:27:27 UTC
(rev 1578)
+++ trunk/src/target/kernel/patches/gta01-core.patch 2007-03-30 19:34:41 UTC
(rev 1579)
@@ -4,7 +4,7 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig
===================================================================
--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-30
20:42:20.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-30
20:45:38.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:32:43.000000000 +0200
@@ -86,6 +86,14 @@
help
Say Y here if you are using the Armzone QT2410
@@ -23,7 +23,7 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile
===================================================================
--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-30
20:42:20.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-30
20:45:37.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:32:42.000000000 +0200
@@ -89,5 +89,6 @@
obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
@@ -34,8 +34,8 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c 2007-03-30
20:45:51.000000000 +0200
-@@ -0,0 +1,562 @@
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-gta01.c 2007-03-30
21:32:59.000000000 +0200
+@@ -0,0 +1,563 @@
+/*
+ * linux/arch/arm/mach-s3c2410/mach-gta01.c
+ *
@@ -146,6 +146,7 @@
+ PCF50606_FEAT_MBC |
+ PCF50606_FEAT_BBC |
+ PCF50606_FEAT_RTC |
++ PCF50606_FEAT_WDT |
+ PCF50606_FEAT_CHGCUR |
+ PCF50606_FEAT_BATVOLT |
+ PCF50606_FEAT_BATTEMP,
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-30 21:34:59 +0200 (Fri, 30 Mar 2007)
New Revision: 1580
Modified:
trunk/src/target/kernel/patches/hxd8-core.patch
Log:
* use new configurable PCF50606 driver
Modified: trunk/src/target/kernel/patches/hxd8-core.patch
===================================================================
--- trunk/src/target/kernel/patches/hxd8-core.patch 2007-03-30 19:34:41 UTC
(rev 1579)
+++ trunk/src/target/kernel/patches/hxd8-core.patch 2007-03-30 19:34:59 UTC
(rev 1580)
@@ -1,8 +1,8 @@
This patch adds another machine, the FIC HXD8
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig
===================================================================
---- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-28
23:11:54.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-28
23:11:54.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:05:37.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:06:10.000000000 +0200
@@ -94,6 +94,12 @@
help
Say Y here if you are using the FIC Neo1973 GSM Phone
@@ -18,8 +18,8 @@
bool "SMDK2440"
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile
===================================================================
---- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-28
23:11:54.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-28
23:11:54.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:05:37.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:06:10.000000000 +0200
@@ -90,5 +90,6 @@
obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o
@@ -30,8 +30,8 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c 2007-03-29
22:20:21.000000000 +0200
-@@ -0,0 +1,359 @@
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c 2007-03-30
21:32:34.000000000 +0200
+@@ -0,0 +1,450 @@
+/* linux/arch/arm/mach-s3c2410/mach-hxd8.c
+ *
+ * S3C2440 Machine Support for the FIC HXD8
@@ -73,6 +73,8 @@
+#include <linux/mtd/nand_ecc.h>
+#include <linux/mtd/partitions.h>
+
++#include <linux/pcf50606.h>
++
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
@@ -217,6 +219,93 @@
+ .sets = hxd8_nand_sets,
+};
+
++/* PMU configuration */
++
++static struct pcf50606_platform_data hxd8_pcf_pdata = {
++ .used_features = PCF50606_FEAT_EXTON |
++ PCF50606_FEAT_BBC |
++ PCF50606_FEAT_WDT |
++ PCF50606_FEAT_RTC |
++ PCF50606_FEAT_PWM |
++ PCF50606_FEAT_BATVOLT,
++ .onkey_seconds_required = 5,
++ .rails = {
++ [PCF50606_REGULATOR_D1REG] = {
++ .name = "rc_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ [PCF50606_REGULATOR_D2REG] = {
++ .name = "gps_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ [PCF50606_REGULATOR_D3REG] = {
++ .name = "io2_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ [PCF50606_REGULATOR_DCD] = {
++ .name = "core_1v3",
++ .voltage = {
++ .init = 1300,
++ .max = 1500,
++ },
++ },
++ [PCF50606_REGULATOR_DCDE] = {
++ .name = "io1_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ [PCF50606_REGULATOR_DCUD] = {
++ .name = "rf_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ [PCF50606_REGULATOR_IOREG] = {
++ .name = "audio_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ [PCF50606_REGULATOR_LPREG] = {
++ .name = "lcm_3v3",
++ .voltage = {
++ .init = 3300,
++ .max = 3300,
++ },
++ },
++ },
++};
++
++static struct resource hxd8_pmu_resources[] = {
++ [0] = {
++ .flags = IORESOURCE_IRQ,
++ .start = HXD8_IRQ_PCF50606,
++ .end = HXD8_IRQ_PCF50606,
++ },
++};
++
++static struct platform_device hxd8_pmu_dev = {
++ .name = "pcf50606",
++ .num_resources = ARRAY_SIZE(hxd8_pmu_resources),
++ .resource = hxd8_pmu_resources,
++ .dev = {
++ .platform_data = &hxd8_pcf_pdata,
++ },
++};
++
+/* LCD driver info */
+
+static struct s3c2410fb_mach_info hxd8_lcd_cfg __initdata = {
@@ -377,6 +466,8 @@
+ //platform_device_register(>a01_button_dev);
+ platform_device_register(&hxd8_pm_gsm_dev);
+
++ platform_device_register(&hxd8_pmu_dev);
++
+ s3c2410_pm_init();
+}
+
@@ -394,8 +485,8 @@
Index: linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h 2007-03-29
22:17:17.000000000 +0200
-@@ -0,0 +1,13 @@
++++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h 2007-03-30
21:06:10.000000000 +0200
+@@ -0,0 +1,16 @@
+#ifndef _HXD8_H
+#define _HXD8_H
+
@@ -407,5 +498,8 @@
+#define HXD8_GPIO_USB_CUR_SEL S3C2410_GPA0
+#define HXD8_GPIO_BACKLIGHT S3C2410_GPB0
+#define HXD8_GPIO_USB_PULLUP S3C2410_GPB9
++#define HXD8_GPIO_PCF50606 S3C2410_GPF6
+
++#define HXD8_IRQ_PCF50606 S3C2410_GPF6_EINT6
++
+#endif
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-30 22:41:21 +0200 (Fri, 30 Mar 2007)
New Revision: 1581
Modified:
trunk/src/target/kernel/patches/gta01-pcf50606.patch
Log:
* add PWM and PWM backlight support
Modified: trunk/src/target/kernel/patches/gta01-pcf50606.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-pcf50606.patch 2007-03-30
19:34:59 UTC (rev 1580)
+++ trunk/src/target/kernel/patches/gta01-pcf50606.patch 2007-03-30
20:41:21 UTC (rev 1581)
@@ -3,12 +3,13 @@
Index: linux-2.6.20.4/drivers/i2c/chips/pcf50606.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-03-30
20:52:22.000000000 +0200
-@@ -0,0 +1,1710 @@
++++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.c 2007-03-30
22:38:29.000000000 +0200
+@@ -0,0 +1,1856 @@
+/* Philips PCF50606 Power Management Unit (PMU) driver
+ *
+ * (C) 2006 by OpenMoko, Inc.
-+ * Author: Harald Welte <[EMAIL PROTECTED]>
++ * Author: Harald Welte <[EMAIL PROTECTED]> +
++ * Matt Hsu <[EMAIL PROTECTED]>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
@@ -32,6 +33,8 @@
+ * - rtc / alarm
+ * - watchdog
+ * - adc driver (hw_sensors like)
++ * - pwm driver
++ * - backlight
+ *
+ */
+
@@ -47,6 +50,8 @@
+#include <linux/watchdog.h>
+#include <linux/miscdevice.h>
+#include <linux/input.h>
++#include <linux/fb.h>
++#include <linux/backlight.h>
+#include <linux/sched.h>
+#include <linux/platform_device.h>
+#include <linux/pcf50606.h>
@@ -91,6 +96,7 @@
+struct pcf50606_data {
+ struct i2c_client client;
+ struct pcf50606_platform_data *pdata;
++ struct backlight_device *backlight;
+ struct mutex lock;
+ unsigned int flags;
+ unsigned int working;
@@ -1344,6 +1350,117 @@
+};
+
+/***********************************************************************
++ * PWM
++ ***********************************************************************/
++
++static const char *pwm_dc_table[] = {
++ "0/16", "1/16", "2/16", "3/16",
++ "4/16", "5/16", "6/16", "7/16",
++ "8/16", "9/16", "10/16","11/16",
++ "12/16", "13/16", "14/16", "15/16",
++};
++
++static ssize_t show_pwm_dc(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct i2c_client *client = to_i2c_client(dev);
++ struct pcf50606_data *pcf = i2c_get_clientdata(client);
++ u_int8_t val;
++
++ val = reg_read(pcf, PCF50606_REG_PWMC1) >> PCF50606_PWMC1_DC_SHIFT;
++ val &= 0xf;
++
++ return sprintf(buf, "%s\n", pwm_dc_table[val]);
++}
++
++static ssize_t set_pwm_dc(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct i2c_client *client = to_i2c_client(dev);
++ struct pcf50606_data *pcf = i2c_get_clientdata(client);
++ u_int8_t i;
++
++ for (i = 0; i < ARRAY_SIZE(pwm_dc_table); i++) {
++ if (!strncmp(buf, pwm_dc_table[i], strlen(pwm_dc_table[i]))) {
++ DEBUGP("setting pwm dc %s\n\r", pwm_dc_table[i]);
++ reg_set_bit_mask(pcf, PCF50606_REG_PWMC1, 0x1e,
++ (i << PCF50606_PWMC1_DC_SHIFT));
++ }
++ }
++ return count;
++}
++
++static DEVICE_ATTR(pwm_dc, S_IRUGO | S_IWUSR, show_pwm_dc, set_pwm_dc);
++
++static const char *pwm_clk_table[] = {
++ "512", "256", "128", "64",
++ "56300", "28100", "14100", "7000",
++};
++
++static ssize_t show_pwm_clk(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct i2c_client *client = to_i2c_client(dev);
++ struct pcf50606_data *pcf = i2c_get_clientdata(client);
++ u_int8_t val;
++
++ val = reg_read(pcf, PCF50606_REG_PWMC1) >> PCF50606_PWMC1_CLK_SHIFT;
++ val &= 0x7;
++
++ return sprintf(buf, "%s\n", pwm_clk_table[val]);
++}
++
++static ssize_t set_pwm_clk(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct i2c_client *client = to_i2c_client(dev);
++ struct pcf50606_data *pcf = i2c_get_clientdata(client);
++ u_int8_t i;
++
++ for (i = 0; i < ARRAY_SIZE(pwm_clk_table); i++) {
++ if (!strncmp(buf, pwm_clk_table[i], strlen(pwm_clk_table[i]))) {
++ DEBUGP("setting pwm clk %s\n\r", pwm_clk_table[i]);
++ reg_set_bit_mask(pcf, PCF50606_REG_PWMC1, 0xe0,
++ (i << PCF50606_PWMC1_CLK_SHIFT));
++ }
++ }
++ return count;
++}
++
++static DEVICE_ATTR(pwm_clk, S_IRUGO | S_IWUSR, show_pwm_clk, set_pwm_clk);
++
++static int pcf50606bl_get_intensity(struct backlight_device *bd)
++{
++ struct pcf50606_data *pcf = class_get_devdata(&bd->class_dev);
++ int intensity = reg_read(pcf, PCF50606_REG_PWMC1);
++ intensity = (intensity >> PCF50606_PWMC1_DC_SHIFT);
++
++ return intensity & 0xf;
++}
++
++static int pcf50606bl_set_intensity(struct backlight_device *bd)
++{
++ struct pcf50606_data *pcf = class_get_devdata(&bd->class_dev);
++ int intensity = bd->props->brightness;
++
++ if (bd->props->power != FB_BLANK_UNBLANK)
++ intensity = 0;
++ if (bd->props->fb_blank != FB_BLANK_UNBLANK)
++ intensity = 0;
++
++ return reg_set_bit_mask(pcf, PCF50606_REG_PWMC1, 0x1e,
++ (intensity << PCF50606_PWMC1_DC_SHIFT));
++}
++
++static struct backlight_properties pcf50606bl_prop = {
++ .owner = THIS_MODULE,
++ .get_brightness = pcf50606bl_get_intensity,
++ .update_status = pcf50606bl_set_intensity,
++ .max_brightness = 16,
++ .brightness = 0,
++};
++
++/***********************************************************************
+ * Input device
+ ***********************************************************************/
+
@@ -1359,7 +1476,7 @@
+};
+#endif
+
-+static struct attribute *pcf_sysfs_entries[15] = {
++static struct attribute *pcf_sysfs_entries[16] = {
+ &dev_attr_voltage_dcd.attr,
+ &dev_attr_voltage_dcde.attr,
+ &dev_attr_voltage_dcud.attr,
@@ -1379,9 +1496,9 @@
+static void populate_sysfs_group(struct pcf50606_data *pcf)
+{
+ int i = 0;
-+ struct attribute *attr;
++ struct attribute **attr;
+
-+ for (attr = pcf_sysfs_entries[0]; attr; attr++)
++ for (attr = pcf_sysfs_entries; *attr; attr++)
+ i++;
+
+ if (pcf->pdata->used_features & PCF50606_FEAT_MBC) {
@@ -1397,6 +1514,11 @@
+
+ if (pcf->pdata->used_features & PCF50606_FEAT_BATTEMP)
+ pcf_sysfs_entries[i++] = &dev_attr_battemp.attr;
++
++ if (pcf->pdata->used_features & PCF50606_FEAT_PWM) {
++ pcf_sysfs_entries[i++] = &dev_attr_pwm_dc.attr;
++ pcf_sysfs_entries[i++] = &dev_attr_pwm_clk.attr;
++ }
+}
+
+static int pcf50606_detect(struct i2c_adapter *adapter, int address, int kind)
@@ -1500,9 +1622,25 @@
+ }
+ }
+
++ if (data->pdata->used_features & PCF50606_FEAT_PWM) {
++ /* enable PWM controller */
++ reg_set_bit_mask(data, PCF50606_REG_PWMC1,
++ PCF50606_PWMC1_ACTSET,
++ PCF50606_PWMC1_ACTSET);
++ }
++
++ if (data->pdata->used_features & PCF50606_FEAT_PWM_BL) {
++ data->backlight = backlight_device_register("pcf50606-bl",
++ &new_client->dev,
++ data,
++ &pcf50606bl_prop);
++ if (!data->backlight)
++ goto exit_misc;
++ }
++
+ data->input_dev = input_allocate_device();
+ if (!data->input_dev)
-+ goto exit_misc;
++ goto exit_pwm;
+
+ data->input_dev->name = "FIC Neo1973 PMU events";
+ data->input_dev->phys = "FIXME";
@@ -1529,6 +1667,9 @@
+#endif
+
+ return 0;
++exit_pwm:
++ if (data->pdata->used_features & PCF50606_FEAT_PWM_BL)
++ backlight_device_unregister(data->backlight);
+exit_misc:
+ if (data->pdata->used_features & PCF50606_FEAT_WDT)
+ misc_deregister(&pcf50606_wdt_miscdev);
@@ -1538,6 +1679,7 @@
+exit_irq:
+ free_irq(GTA01_IRQ_PCF50606, pcf50606_global);
+exit_sysfs:
++ pm_power_off = NULL;
+ sysfs_remove_group(&new_client->dev.kobj, &pcf_attr_group);
+exit_detach:
+ i2c_detach_client(new_client);
@@ -1562,17 +1704,21 @@
+ apm_get_power_status = NULL;
+ input_unregister_device(pcf->input_dev);
+
++ if (pcf->pdata->used_features & PCF50606_FEAT_PWM_BL)
++ backlight_device_unregister(pcf->backlight);
++
+ if (pcf->pdata->used_features & PCF50606_FEAT_WDT)
+ misc_deregister(&pcf50606_wdt_miscdev);
+
-+ free_irq(GTA01_IRQ_PCF50606, pcf);
-+
+ if (pcf->pdata->used_features & PCF50606_FEAT_RTC)
+ rtc_device_unregister(pcf->rtc);
-+ pm_power_off = NULL;
+
++ free_irq(GTA01_IRQ_PCF50606, pcf);
++
+ sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
+
++ pm_power_off = NULL;
++
+ kfree(pcf);
+
+ return 0;
@@ -1718,8 +1864,8 @@
Index: linux-2.6.20.4/drivers/i2c/chips/pcf50606.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.h 2007-03-26
19:01:17.000000000 +0200
-@@ -0,0 +1,259 @@
++++ linux-2.6.20.4/drivers/i2c/chips/pcf50606.h 2007-03-30
22:07:41.000000000 +0200
+@@ -0,0 +1,288 @@
+#ifndef _PCF50606_H
+#define _PCF50606_H
+
@@ -1977,6 +2123,35 @@
+ PCF50606_BVMC_DISDB = 0x10,
+};
+
++enum pcf50606_reg_pwmc1 {
++ PCF50606_PWMC1_ACTSET = 0x01,
++ PCF50606_PWMC1_PWMDC_0_16 = 0x00,
++ PCF50606_PWMC1_PWMDC_1_16 = 0x02,
++ PCF50606_PWMC1_PWMDC_2_16 = 0x04,
++ PCF50606_PWMC1_PWMDC_3_16 = 0x06,
++ PCF50606_PWMC1_PWMDC_4_16 = 0x08,
++ PCF50606_PWMC1_PWMDC_5_16 = 0x0a,
++ PCF50606_PWMC1_PWMDC_6_16 = 0x0c,
++ PCF50606_PWMC1_PWMDC_7_16 = 0x0e,
++ PCF50606_PWMC1_PWMDC_8_16 = 0x10,
++ PCF50606_PWMC1_PWMDC_9_16 = 0x12,
++ PCF50606_PWMC1_PWMDC_10_16 = 0x14,
++ PCF50606_PWMC1_PWMDC_11_16 = 0x16,
++ PCF50606_PWMC1_PWMDC_12_16 = 0x18,
++ PCF50606_PWMC1_PWMDC_13_16 = 0x1a,
++ PCF50606_PWMC1_PWMDC_14_16 = 0x1c,
++ PCF50606_PWMC1_PWMDC_15_16 = 0x1e,
++ PCF50606_PWMC1_PRESC_512Hz = 0x20,
++ PCF50606_PWMC1_PRESC_256Hz = 0x40,
++ PCF50606_PWMC1_PRESC_64Hz = 0x60,
++ PCF50606_PWMC1_PRESC_56kHz = 0x80,
++ PCF50606_PWMC1_PRESC_28kHz = 0xa0,
++ PCF50606_PWMC1_PRESC_14kHz = 0xc0,
++ PCF50606_PWMC1_PRESC_7kHz = 0xe0,
++};
++#define PCF50606_PWMC1_CLK_SHIFT 5
++#define PCF50606_PWMC1_DC_SHIFT 1
++
+#endif /* _PCF50606_H */
+
Index: linux-2.6.20.4/drivers/i2c/chips/Kconfig
@@ -2028,8 +2203,8 @@
Index: linux-2.6.20.4/include/linux/pcf50606.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/include/linux/pcf50606.h 2007-03-30 20:51:20.000000000
+0200
-@@ -0,0 +1,86 @@
++++ linux-2.6.20.4/include/linux/pcf50606.h 2007-03-30 22:26:05.000000000
+0200
+@@ -0,0 +1,87 @@
+#ifndef _LINUX_PCF50606_H
+#define _LINUX_PCF50606_H
+
@@ -2095,6 +2270,7 @@
+#define PCF50606_FEAT_CHGCUR 0x00000100
+#define PCF50606_FEAT_BATVOLT 0x00000200
+#define PCF50606_FEAT_BATTEMP 0x00000400
++#define PCF50606_FEAT_PWM_BL 0x00000800
+
+struct pcf50606_platform_data {
+ /* general */
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-30 22:41:54 +0200 (Fri, 30 Mar 2007)
New Revision: 1582
Modified:
trunk/src/target/kernel/patches/hxd8-core.patch
Log:
* remove gta01bl device (we use PMU PWM)
* use new PWM_BL feature of PMU driver
Modified: trunk/src/target/kernel/patches/hxd8-core.patch
===================================================================
--- trunk/src/target/kernel/patches/hxd8-core.patch 2007-03-30 20:41:21 UTC
(rev 1581)
+++ trunk/src/target/kernel/patches/hxd8-core.patch 2007-03-30 20:41:54 UTC
(rev 1582)
@@ -1,8 +1,8 @@
This patch adds another machine, the FIC HXD8
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig
===================================================================
---- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:05:37.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:06:10.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:33:04.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Kconfig 2007-03-30
21:33:04.000000000 +0200
@@ -94,6 +94,12 @@
help
Say Y here if you are using the FIC Neo1973 GSM Phone
@@ -18,8 +18,8 @@
bool "SMDK2440"
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile
===================================================================
---- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:05:37.000000000 +0200
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:06:10.000000000 +0200
+--- linux-2.6.20.4.orig/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:32:42.000000000 +0200
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/Makefile 2007-03-30
21:33:04.000000000 +0200
@@ -90,5 +90,6 @@
obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o
@@ -30,8 +30,8 @@
Index: linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c 2007-03-30
21:32:34.000000000 +0200
-@@ -0,0 +1,450 @@
++++ linux-2.6.20.4/arch/arm/mach-s3c2410/mach-hxd8.c 2007-03-30
22:39:28.000000000 +0200
+@@ -0,0 +1,428 @@
+/* linux/arch/arm/mach-s3c2410/mach-hxd8.c
+ *
+ * S3C2440 Machine Support for the FIC HXD8
@@ -227,6 +227,7 @@
+ PCF50606_FEAT_WDT |
+ PCF50606_FEAT_RTC |
+ PCF50606_FEAT_PWM |
++ PCF50606_FEAT_PWM_BL |
+ PCF50606_FEAT_BATVOLT,
+ .onkey_seconds_required = 5,
+ .rails = {
@@ -356,28 +357,6 @@
+ },
+};
+
-+static struct gta01bl_machinfo backlight_machinfo = {
-+ .default_intensity = 1,
-+ .max_intensity = 1,
-+ .limit_mask = 1,
-+};
-+
-+static struct resource hxd8_bl_resources[] = {
-+ [0] = {
-+ .start = HXD8_GPIO_BACKLIGHT,
-+ .end = HXD8_GPIO_BACKLIGHT,
-+ },
-+};
-+
-+struct platform_device hxd8_bl_dev = {
-+ .name = "gta01-bl",
-+ .num_resources = ARRAY_SIZE(hxd8_bl_resources),
-+ .resource = hxd8_bl_resources,
-+ .dev = {
-+ .platform_data = &backlight_machinfo,
-+ },
-+};
-+
+static struct platform_device hxd8_pm_gsm_dev = {
+ .name = "gta01-pm-gsm",
+};
@@ -462,7 +441,6 @@
+ s3c24xx_udc_set_platdata(&hxd8_udc_cfg);
+ set_s3c2410ts_info(&hxd8_ts_cfg);
+
-+ platform_device_register(&hxd8_bl_dev);
+ //platform_device_register(>a01_button_dev);
+ platform_device_register(&hxd8_pm_gsm_dev);
+
@@ -485,7 +463,7 @@
Index: linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h 2007-03-30
21:06:10.000000000 +0200
++++ linux-2.6.20.4/include/asm-arm/arch-s3c2410/hxd8.h 2007-03-30
21:33:04.000000000 +0200
@@ -0,0 +1,16 @@
+#ifndef _HXD8_H
+#define _HXD8_H
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog