|
From: <mar...@us...> - 2007-09-21 00:53:22
|
Revision: 1335
http://hackndev.svn.sourceforge.net/hackndev/?rev=1335&view=rev
Author: marex_z71
Date: 2007-09-20 17:53:12 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
PalmZ72: migrate to universal LCD border driver - palmlcd_border
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
Removed Paths:
-------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Kconfig 2007-09-21 00:53:12 UTC (rev 1335)
@@ -21,9 +21,3 @@
help
Enable support for PalmOne Zire 72 battery to APM.
ATM use it only as module, otherwise it hangs.
-
-config PALMZ72_BORDER
- tristate "Palm Zire 72 Display border switch"
- depends on MACH_PALMZ72
- help
- Enable support for turning LCD border on/off
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/Makefile 2007-09-21 00:53:12 UTC (rev 1335)
@@ -5,4 +5,3 @@
obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
obj-$(CONFIG_PALMZ72_PM) += palmz72_pm.o
obj-$(CONFIG_PALMZ72_BATTERY) += palmz72_battery.o
-obj-$(CONFIG_PALMZ72_BORDER) += palmz72_border.o
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72.c 2007-09-21 00:53:12 UTC (rev 1335)
@@ -42,6 +42,7 @@
#include <asm/arch/palmz72-init.h>
#include <asm/arch/pxa_camera.h>
#include <asm/arch/pxa2xx_udc_gpio.h>
+#include <asm/arch/palmlcd-border.h>
#include <sound/driver.h>
#include <sound/core.h>
@@ -315,9 +316,17 @@
/**************
* LCD Border *
**************/
+static struct palmlcd_border_pdata border_machinfo = {
+ .select_gpio = GPIO_NR_PALMZ72_BORDER_SELECT,
+ .switch_gpio = GPIO_NR_PALMZ72_BORDER_SWITCH,
+};
+
struct platform_device palmz72_border = {
- .name = "palmz72-border",
- .id = -1,
+ .name = "palmlcd-border",
+ .id = -1,
+ .dev = {
+ .platform_data = &border_machinfo,
+ },
};
/*************
Deleted: linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c 2007-09-21 00:51:33 UTC (rev 1334)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmz72/palmz72_border.c 2007-09-21 00:53:12 UTC (rev 1335)
@@ -1,115 +0,0 @@
-/*
- * PalmOne Zire 72 LCD Border switch
- * (Based on Palm LD LCD border switch)
- *
- * Author: Marek Vasut <mar...@gm...>
- * Modification for Palm Zire 72: Jan Herman <z7...@ha...>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-
-#include <asm/arch/hardware.h>
-#include <asm/arch/palmz72-gpio.h>
-
-static ssize_t palmz72_border_write(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- signed long state = simple_strtol(buf, NULL, 10);
-
- if ( state >= 1 )
- SET_PALMZ72_GPIO(BORDER_SELECT, 1);
- else
- SET_PALMZ72_GPIO(BORDER_SELECT, 0);
-
- msleep(50);
- SET_PALMZ72_GPIO(BORDER_SWITCH, 1);
-
- if ((state == 1) || (state == 0)) /* default - switch border on/off */
- msleep(200);
- else { /* hidden functionality - colored border */
- if (state >= 0)
- msleep(state);
- else
- msleep(-state);
- }
-
- SET_PALMZ72_GPIO(BORDER_SWITCH, 0);
-
- return count;
-}
-
-static ssize_t palmz72_border_read(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- return strlcpy(buf, GET_PALMZ72_GPIO(BORDER_SELECT) ? "1\n" : "0\n", 3);
-}
-
-static DEVICE_ATTR(border_power, 0644, palmz72_border_read, palmz72_border_write);
-
-static struct attribute *palmz72_border_attrs[] = {
- &dev_attr_border_power.attr,
- NULL
-};
-
-static struct attribute_group palmz72_border_attr_group = {
- .attrs = palmz72_border_attrs,
-};
-
-static int __devinit palmz72_border_probe(struct platform_device *pdev)
-{
- return sysfs_create_group(&pdev->dev.kobj, &palmz72_border_attr_group);
-}
-
-static int palmz72_border_remove(struct platform_device *pdev)
-{
- sysfs_remove_group(&pdev->dev.kobj, &palmz72_border_attr_group);
- return 0;
-}
-
-static struct platform_driver palmz72_border_driver = {
- .probe = palmz72_border_probe,
- .remove = palmz72_border_remove,
- .suspend = NULL,
- .resume = NULL,
- .driver = {
- .name = "palmz72-border",
- }
-};
-
-static int __init palmz72_border_init(void)
-{
- printk(KERN_INFO "LCD border driver registered\n");
- return platform_driver_register(&palmz72_border_driver);
-}
-
-static void palmz72_border_exit(void)
-{
- printk(KERN_INFO "LCD border driver unregistered\n");
- platform_driver_unregister(&palmz72_border_driver);
-}
-
-module_init(palmz72_border_init);
-module_exit(palmz72_border_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jan Herman <z7...@ha...>");
-MODULE_DESCRIPTION("PalmOne Zire72 Border switch");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|