|
From: <sle...@us...> - 2007-06-29 00:08:31
|
Revision: 1093
http://svn.sourceforge.net/hackndev/?rev=1093&view=rev
Author: sleep_walker
Date: 2007-06-28 17:08:27 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
palmtt3: added led device, tsc2101 PLL set to other values
Modified Paths:
--------------
linux4palm/linux/trunk/drivers/leds/Kconfig
linux4palm/linux/trunk/drivers/leds/Makefile
linux4palm/linux/trunk/drivers/mfd/tsc2101.c
linux4palm/linux/trunk/drivers/misc/gpioed-ng.c
Added Paths:
-----------
linux4palm/linux/trunk/drivers/leds/leds-palmtt3.c
Modified: linux4palm/linux/trunk/drivers/leds/Kconfig
===================================================================
--- linux4palm/linux/trunk/drivers/leds/Kconfig 2007-06-28 23:46:35 UTC (rev 1092)
+++ linux4palm/linux/trunk/drivers/leds/Kconfig 2007-06-29 00:08:27 UTC (rev 1093)
@@ -129,6 +129,12 @@
help
This option enables support for the LEDs on Palm LifeDrive.
+config LEDS_PALMTT3
+ tristate "LED Support for Palm Tungsten|T3"
+ depends LEDS_CLASS && MACH_T3XSCALE && TPS65010
+ help
+ This option enables support for the LEDs on Palm Tungsten|T3.
+
config LEDS_PALMZ72
tristate "LED Support for PalmOne Zire 72"
depends LEDS_CLASS && MACH_PALMZ72
Modified: linux4palm/linux/trunk/drivers/leds/Makefile
===================================================================
--- linux4palm/linux/trunk/drivers/leds/Makefile 2007-06-28 23:46:35 UTC (rev 1092)
+++ linux4palm/linux/trunk/drivers/leds/Makefile 2007-06-29 00:08:27 UTC (rev 1093)
@@ -26,6 +26,7 @@
# Hack&Dev drivers
obj-$(CONFIG_LEDS_PALMLD) += leds-palmld.o
+obj-$(CONFIG_LEDS_PALMTT3) += leds-palmtt3.o
obj-$(CONFIG_LEDS_PALMZ72) += led-palmz72.o
obj-$(CONFIG_LEDS_PALMT650) += leds-palmt650.o
Added: linux4palm/linux/trunk/drivers/leds/leds-palmtt3.c
===================================================================
--- linux4palm/linux/trunk/drivers/leds/leds-palmtt3.c (rev 0)
+++ linux4palm/linux/trunk/drivers/leds/leds-palmtt3.c 2007-06-29 00:08:27 UTC (rev 1093)
@@ -0,0 +1,120 @@
+/*
+ * Palm LifeDrive LED Driver
+ *
+ * Author: Tomas Cech <Tom...@ma...>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <asm/mach-types.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/hardware/scoop.h>
+#include <asm/arch/tps65010.h>
+
+
+static void palmtt3led_red_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value <= 85)
+ tps65010_set_led(LED2, OFF);
+ else
+ if (value <= 170)
+ tps65010_set_led(LED2, ON);
+ else
+ tps65010_set_led(LED2, BLINK);
+}
+
+static void palmtt3led_green_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value <= 85)
+ tps65010_set_led(LED1, OFF);
+ else
+ if (value <= 170)
+ tps65010_set_led(LED1, ON);
+ else
+ tps65010_set_led(LED1, BLINK);
+}
+
+static struct led_classdev palmtt3_red_led = {
+ .name = "palmtt3:red",
+ .brightness_set = palmtt3led_red_set,
+};
+
+static struct led_classdev palmtt3_green_led = {
+ .name = "palmtt3:green",
+ .brightness_set = palmtt3led_green_set,
+};
+
+#ifdef CONFIG_PM
+static int palmtt3led_suspend(struct platform_device *dev, pm_message_t state)
+{
+ led_classdev_suspend(&palmtt3_red_led);
+ led_classdev_suspend(&palmtt3_green_led);
+ return 0;
+}
+
+static int palmtt3led_resume(struct platform_device *dev)
+{
+ led_classdev_resume(&palmtt3_red_led);
+ led_classdev_resume(&palmtt3_green_led);
+ return 0;
+}
+#endif
+
+static int palmtt3led_probe(struct platform_device *pdev)
+{
+ int ret;
+
+ ret = led_classdev_register(&pdev->dev, &palmtt3_red_led);
+ if (ret < 0)
+ return ret;
+
+ ret = led_classdev_register(&pdev->dev, &palmtt3_green_led);
+ if (ret < 0)
+ led_classdev_unregister(&palmtt3_red_led);
+
+ return ret;
+}
+
+static int palmtt3led_remove(struct platform_device *pdev)
+{
+ led_classdev_unregister(&palmtt3_red_led);
+ led_classdev_unregister(&palmtt3_green_led);
+ return 0;
+}
+
+static struct platform_driver palmtt3led_driver = {
+ .probe = palmtt3led_probe,
+ .remove = palmtt3led_remove,
+#ifdef CONFIG_PM
+ .suspend = palmtt3led_suspend,
+ .resume = palmtt3led_resume,
+#endif
+ .driver = {
+ .name = "palmtt3-led",
+ },
+};
+
+static int __init palmtt3led_init(void)
+{
+ return platform_driver_register(&palmtt3led_driver);
+}
+
+static void __exit palmtt3led_exit(void)
+{
+ platform_driver_unregister(&palmtt3led_driver);
+}
+
+module_init(palmtt3led_init);
+module_exit(palmtt3led_exit);
+
+MODULE_AUTHOR("Tomas Cech <Tom...@ma...");
+MODULE_DESCRIPTION("Palm Tungsten|T3 LED driver");
+MODULE_LICENSE("GPL");
Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c
===================================================================
--- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-28 23:46:35 UTC (rev 1092)
+++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-29 00:08:27 UTC (rev 1093)
@@ -227,8 +227,8 @@
if (fs_44) {
/* 44.1 khz - 12 MHz Mclk */
printk("selected 44.1khz PLL\n");
- tsc2101_regwrite(snd_data, TSC2101_REG_PLL1, TSC2101_PLL_ENABLE | TSC2101_PLL_PVAL(2) | TSC2101_PLL_JVAL(7));
- tsc2101_regwrite(snd_data, TSC2101_REG_PLL2, TSC2101_PLL2_DVAL(5740));
+ tsc2101_regwrite(snd_data, TSC2101_REG_PLL1, TSC2101_PLL_ENABLE | TSC2101_PLL_PVAL(1) | TSC2101_PLL_JVAL(7));
+ tsc2101_regwrite(snd_data, TSC2101_REG_PLL2, TSC2101_PLL2_DVAL(5264));
} else {
/* 48 khz - 12 Mhz Mclk */
printk("selected 48khz PLL\n");
Modified: linux4palm/linux/trunk/drivers/misc/gpioed-ng.c
===================================================================
--- linux4palm/linux/trunk/drivers/misc/gpioed-ng.c 2007-06-28 23:46:35 UTC (rev 1092)
+++ linux4palm/linux/trunk/drivers/misc/gpioed-ng.c 2007-06-29 00:08:27 UTC (rev 1093)
@@ -98,7 +98,6 @@
printk(KERN_ERR "GPIOed: GPIO %lu set low\n", id);
break;
#ifdef CONFIG_MACH_T3XSCALE
-#ifdef CONFIG_TPS65010
case 'T':
tps65010_set_gpio_out_value(id, 1);
printk(KERN_ERR "GPIOed: GPIO %lu set high on TPS65010\n", id);
@@ -108,7 +107,6 @@
printk(KERN_ERR "GPIOed: GPIO %lu set low on TPS65010\n", id);
break;
#endif
-#endif
case 'd':
GPDR(id) &= ~(GPIO_bit(id));
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|