|
From: <hap...@us...> - 2007-09-14 13:08:28
|
Revision: 1316
http://hackndev.svn.sourceforge.net/hackndev/?rev=1316&view=rev
Author: happy-slapin
Date: 2007-09-14 06:08:25 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
cleanup: Device cleanup
Modified Paths:
--------------
linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/asus730/a730_flash.c
linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/generic.c
linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/h5400/h5400.c
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/asus730/a730_flash.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/asus730/a730_flash.c 2007-09-14 12:44:17 UTC (rev 1315)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/asus730/a730_flash.c 2007-09-14 13:08:25 UTC (rev 1316)
@@ -117,9 +117,8 @@
static struct mtd_info *mtds_concat = NULL;
static int mtds_found = 0;
-#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probes[] = {"cmdlinepart", "RedBoot", NULL};
-#endif
+
static int mphysmap_map_device(struct map_info *map)
{
static const char *rom_probe_types[] = {"cfi_probe", "jedec_probe", "map_rom", NULL};
@@ -184,10 +183,9 @@
static int a730_physmap_flash_probe(struct device *dev)
{
int i;
-#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition* mtd_parts;
int mtd_parts_nb;
-#endif
+
for (i = 0; i < ARRAY_SIZE(mphysmap_static_maps); i++)
{
if (strcmp(mphysmap_static_maps[i].name, "") != 0 && mphysmap_static_maps[i].size != 0 && mphysmap_static_maps[i].bankwidth != 0)
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/generic.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/generic.c 2007-09-14 12:44:17 UTC (rev 1315)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/generic.c 2007-09-14 13:08:25 UTC (rev 1316)
@@ -233,6 +233,21 @@
#include <linux/gpiodev2.h>
struct gpio_ops gpio_desc[16];
+
+int gpio_direction_input(unsigned gpio)
+{
+ if (gpio < GPIO_BASE_INCREMENT)
+ return pxa_gpio_mode(gpio | GPIO_IN);
+ return -EINVAL;
+}
+
+int gpio_direction_output(unsigned gpio)
+{
+ if (gpio < GPIO_BASE_INCREMENT)
+ return pxa_gpio_mode(gpio | GPIO_OUT);
+ return -EINVAL;
+}
+
/*
* Return GPIO level
*/
@@ -252,7 +267,8 @@
{
if (gpio < GPIO_BASE_INCREMENT)
__gpio_set_value(gpio, value);
- gpiodev2_set_value(gpio, value);
+ else
+ gpiodev2_set_value(gpio, value);
}
EXPORT_SYMBOL(pxa_gpio_set_value);
Modified: linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/h5400/h5400.c
===================================================================
--- linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/h5400/h5400.c 2007-09-14 12:44:17 UTC (rev 1315)
+++ linux4palm/linux/branches/cleanup-branch-never-commit/arch/arm/mach-pxa/h5400/h5400.c 2007-09-14 13:08:25 UTC (rev 1316)
@@ -38,8 +38,7 @@
#include <linux/input_pda.h>
#include <linux/adc.h>
#include <linux/mfd/samcop_adc.h>
-#include <linux/gpiodev_keys.h>
-#include <linux/gpiodev_diagonal.h>
+#include <linux/gpiodev_keys2.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
@@ -508,7 +507,7 @@
GPIO_NR_H5400_IRDA_SD | GPIO_OUT, /* GPIO58 */
59 | GPIO_OUT, /* GPIO59 XXX docs say "usb charge on" input */
GPIO_NR_H5400_POWER_SD_N | GPIO_OUT, /* GPIO60 XXX not really active low? */
- GPIO_NR_H5400_POWER_RS232_N | GPIO_OUT | GPIO_DFLT_HIGH,
+ GPIO_NR_H5400_POWER_RS232_N_OR_FS | GPIO_OUT | GPIO_DFLT_HIGH,
GPIO_NR_H5400_POWER_ACCEL_N | GPIO_OUT | GPIO_DFLT_HIGH,
63 | GPIO_OUT, /* GPIO63 NC */
GPIO_NR_H5400_OPT_NVRAM | GPIO_OUT ,
@@ -649,8 +648,8 @@
.gpacon2 = 0x5a,
.gpadat = 0x0,
.gpaup = 0x0,
- .gpioint = { 0x66666666, 0x60006, 0x0, },
- .gpioflt = { 0x3fff0000, 0x3fff3fff, 0x3fff, 0, 0, 0x3fff3fff, 0, },
+ .gpioint = { 0xeeeeeeee, 0x6766eeee, 0x0444444f, },
+ .gpioflt = { 0x3fff0001, 0x3fff3fff, 0x3fff3fff, 0x3fff3fff, 0x3fff3fff, 0x3fff3fff, 0x000f3fff, },
.gpioenint = { 0x3f, 0x7f, },
},
.child_devs = samcop_child_devs,
@@ -669,52 +668,68 @@
};
EXPORT_SYMBOL(h5400_samcop);
-static struct gpiodev_keys_button h5400_button_table[] = {
- { KEY_POWER, { &pxagpio_device.dev, GPIO_NR_H5400_POWER_BUTTON }, 1, "Power button" },
- { _KEY_RECORD, { &h5400_samcop.dev, SAMCOP_GPA_RECORD }, 1, "Record button" },
- { _KEY_CALENDAR, { &h5400_samcop.dev, SAMCOP_GPA_APPBTN1 }, 1, "Calendar button" },
- { _KEY_CONTACTS, { &h5400_samcop.dev, SAMCOP_GPA_APPBTN2 }, 1, "Contacts button" },
- { _KEY_MAIL, { &h5400_samcop.dev, SAMCOP_GPA_APPBTN3 }, 1, "Mail button" },
- { _KEY_HOMEPAGE, { &h5400_samcop.dev, SAMCOP_GPA_APPBTN4 }, 1, "Homepage button" },
- { KEY_VOLUMEUP, { &h5400_samcop.dev, SAMCOP_GPA_TOGGLEUP }, 1, "Volume up" },
- { KEY_VOLUMEDOWN, { &h5400_samcop.dev, SAMCOP_GPA_TOGGLEDOWN }, 1, "Volume down" },
+static struct gpiodev_keys2_gpio h5000_gpiodev_keys2_gpios[] = {
+ { "Power button", { &pxagpio_device.dev, GPIO_NR_H5400_POWER_BUTTON }, 0, },
+ { "Record button", { &h5400_samcop.dev, SAMCOP_GPA_RECORD }, 1, },
+ { "Calendar button", { &h5400_samcop.dev, SAMCOP_GPA_APPBTN1 }, 1, },
+ { "Contacts button", { &h5400_samcop.dev, SAMCOP_GPA_APPBTN2 }, 1, },
+ { "Mail button", { &h5400_samcop.dev, SAMCOP_GPA_APPBTN3 }, 1, },
+ { "Homepage button", { &h5400_samcop.dev, SAMCOP_GPA_APPBTN4 }, 1, },
+ { "Volume up", { &h5400_samcop.dev, SAMCOP_GPA_TOGGLEUP }, 1, },
+ { "Volume down", { &h5400_samcop.dev, SAMCOP_GPA_TOGGLEDOWN }, 1, },
+ { "Joypad NW", { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK1 }, 1, },
+ { "Joypad NE", { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK2 }, 1, },
+ { "Joypad SE", { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK3 }, 1, },
+ { "Joypad SW", { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK4 }, 1, },
+ { "Joypad action", { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK5 }, 1, },
};
-
-static struct gpiodev_keys_platform_data h5400_pxa_keys_data = {
- .buttons = h5400_button_table,
- .nbuttons = ARRAY_SIZE(h5400_button_table),
+static struct gpiodev_keys2_button h5000_gpiodev_keys2_buttons[] = {
+ { KEY_POWER, { "Power button", NULL }, 0, 0, },
+ { _KEY_CALENDAR, { "Calendar button", NULL }, 0, 0, },
+ { _KEY_CONTACTS, { "Contacts button", NULL }, 0, 0, },
+ { _KEY_MAIL, { "Mail button", NULL }, 0, 0, },
+ { _KEY_HOMEPAGE, { "Homepage button", NULL }, 0, 0, },
+ /* Side buttons */
+ { _KEY_RECORD, { "Record button", "Volume up", "Volume down", NULL }, 75, 1, },
+ { KEY_VOLUMEUP, { "Volume up", NULL }, 75, 0, },
+ { KEY_VOLUMEDOWN, { "Volume down", "Record button", NULL }, 75, 0, },
+ /* Diagonal joypad */
+ { KEY_ENTER, { "Joypad action", NULL }, 0, 0},
+ /* One diagonal pressed */
+ /* NE */
+ { KEY_UP, { "Joypad NE", "Joypad action", NULL}, 0, 1},
+ { KEY_RIGHT, { "Joypad NE", "Joypad action", NULL}, 0, 1},
+ /* NW */
+ { KEY_UP, { "Joypad NW", "Joypad action", NULL}, 0, 1},
+ { KEY_LEFT, { "Joypad NW", "Joypad action", NULL}, 0, 1},
+ /* SE */
+ { KEY_DOWN, { "Joypad SE", "Joypad action", NULL}, 0, 1},
+ { KEY_RIGHT, { "Joypad SE", "Joypad action", NULL}, 0, 1},
+ /* SW */
+ { KEY_DOWN, { "Joypad SW", "Joypad action", NULL}, 0, 1},
+ { KEY_LEFT, { "Joypad SW", "Joypad action", NULL}, 0, 1},
+ /* Two diagonals pressed */
+ { KEY_UP, { "Joypad NE", "Joypad NW", "Joypad action", NULL }, 0, 2},
+ { KEY_LEFT, { "Joypad NW", "Joypad SW", "Joypad action", NULL }, 0, 2},
+ { KEY_DOWN, { "Joypad SW", "Joypad SE", "Joypad action", NULL }, 0, 2},
+ { KEY_RIGHT, { "Joypad SE", "Joypad NE", "Joypad action", NULL }, 0, 2},
};
-static struct platform_device h5400_pxa_keys = {
- .name = "gpiodev-keys",
- .dev = {
- .platform_data = &h5400_pxa_keys_data,
- },
+static struct gpiodev_keys2_platform_data h5000_gpiodev_keys2_platform_data = {
+ .gpios = h5000_gpiodev_keys2_gpios,
+ .ngpios = ARRAY_SIZE(h5000_gpiodev_keys2_gpios),
+ .buttons = h5000_gpiodev_keys2_buttons,
+ .nbuttons = ARRAY_SIZE(h5000_gpiodev_keys2_buttons),
};
-static struct gpiodev_diagonal_button h5400_joypad_table[] = {
- { { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK1 }, 1, GPIODEV_DIAG_LEFT | GPIODEV_DIAG_UP, "Joypad left-up" },
- { { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK2 }, 1, GPIODEV_DIAG_RIGHT | GPIODEV_DIAG_UP, "Joypad right-up" },
- { { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK3 }, 1, GPIODEV_DIAG_RIGHT | GPIODEV_DIAG_DOWN, "Joypad right-down" },
- { { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK4 }, 1, GPIODEV_DIAG_LEFT | GPIODEV_DIAG_DOWN, "Joypad left-down" },
- { { &h5400_samcop.dev, SAMCOP_GPA_JOYSTICK5 }, 1, GPIODEV_DIAG_ACTION, "Joypad action" },
-};
-
-static struct gpiodev_diagonal_platform_data h5400_pxa_joypad_data = {
- .buttons = h5400_joypad_table,
- .nbuttons = ARRAY_SIZE(h5400_joypad_table),
- .dir_disables_enter = 1,
-};
-
-static struct platform_device h5400_pxa_joypad = {
- .name = "gpiodev-diagonal",
+static struct platform_device h5000_gpiodev_keys2 = {
+ .name = "gpiodev-keys2",
.dev = {
- .platform_data = &h5400_pxa_joypad_data,
+ .platform_data = &h5000_gpiodev_keys2_platform_data,
},
};
-
static void __init
h5400_init (void)
{
@@ -723,8 +738,7 @@
platform_device_register (&h5000_flash[0]);
platform_device_register (&h5000_flash[1]);
platform_device_register (&h5400_samcop);
- platform_device_register (&h5400_pxa_keys);
- platform_device_register (&h5400_pxa_joypad);
+ platform_device_register (&h5000_gpiodev_keys2);
pxa_set_udc_info (&h5400_udc_mach_info);
pxa_set_dma_needs_bounce (h5400_dma_needs_bounce);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|