Skip to content

Commit

Permalink
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Browse files Browse the repository at this point in the history
* master.kernel.org:/home/rmk/linux-2.6-arm:
  Allow architectures to override copy_user_highpage()
  [ARM] pxa/palmtx: misc fixes to use generic GPIO API
  ARM: OMAP: Fixes for suspend / resume GPIO wake-up handling
  [ARM] pxa/corgi: update default config to exclude tosa from being built
  [ARM] pxa/pcm990: use negative number for an invalid GPIO in camera data
  ARM: OMAP: Typo fix for clock_allow_idle
  ARM: OMAP: Remove broken LCD driver for SX1
  [ARM] 5335/1: pxa25x_udc: Fix is_vbus_present to return 1 or 0
  [ARM] pxa/MioA701: bluetooth resume fix
  [ARM] pxa/MioA701: fix memory corruption.
  • Loading branch information
Linus Torvalds committed Dec 1, 2008
2 parents a6e470f + af38d90 commit 4ec8f07
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 372 deletions.
2 changes: 1 addition & 1 deletion arch/arm/configs/corgi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ CONFIG_MACH_HUSKY=y
# CONFIG_MACH_AKITA is not set
# CONFIG_MACH_SPITZ is not set
# CONFIG_MACH_BORZOI is not set
CONFIG_MACH_TOSA=y
# CONFIG_MACH_TOSA is not set
# CONFIG_ARCH_VIPER is not set
# CONFIG_ARCH_PXA_ESERIES is not set
# CONFIG_TRIZEPS_PXA is not set
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/mioa701.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state)
u32 *mem_resume_unknown = phys_to_virt(RESUME_UNKNOWN_ADDR);

/* Devices prepare suspend */
is_bt_on = gpio_get_value(GPIO83_BT_ON);
is_bt_on = !!gpio_get_value(GPIO83_BT_ON);
pxa2xx_mfp_set_lpm(GPIO83_BT_ON,
is_bt_on ? MFP_LPM_DRIVE_HIGH : MFP_LPM_DRIVE_LOW);

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/mioa701_bootresume.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ENTRY(mioa701_jumpaddr)
1:
mov r0, #0xa0000000 @ Don't suppose memory access works
orr r0, r0, #0x00200000 @ even if it's supposed to
orr r0, r0, #0x0000b000
mov r1, #0
str r1, [r0] @ Early disable resume for next boot
ldr r0, mioa701_jumpaddr @ (Murphy's Law)
Expand Down
150 changes: 118 additions & 32 deletions arch/arm/mach-pxa/palmtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ static unsigned long palmtx_pin_config[] __initdata = {
GPIO110_MMC_DAT_2,
GPIO111_MMC_DAT_3,
GPIO112_MMC_CMD,
GPIO14_GPIO, /* SD detect */
GPIO114_GPIO, /* SD power */
GPIO115_GPIO, /* SD r/o switch */

/* AC97 */
GPIO28_AC97_BITCLK,
Expand All @@ -64,14 +67,16 @@ static unsigned long palmtx_pin_config[] __initdata = {
GPIO31_AC97_SYNC,

/* IrDA */
GPIO40_GPIO, /* ir disable */
GPIO46_FICP_RXD,
GPIO47_FICP_TXD,

/* PWM */
GPIO16_PWM0_OUT,

/* USB */
GPIO13_GPIO,
GPIO13_GPIO, /* usb detect */
GPIO95_GPIO, /* usb power */

/* PCMCIA */
GPIO48_nPOE,
Expand All @@ -84,6 +89,45 @@ static unsigned long palmtx_pin_config[] __initdata = {
GPIO55_nPREG,
GPIO56_nPWAIT,
GPIO57_nIOIS16,
GPIO94_GPIO, /* wifi power 1 */
GPIO108_GPIO, /* wifi power 2 */
GPIO116_GPIO, /* wifi ready */

/* MATRIX KEYPAD */
GPIO100_KP_MKIN_0,
GPIO101_KP_MKIN_1,
GPIO102_KP_MKIN_2,
GPIO97_KP_MKIN_3,
GPIO103_KP_MKOUT_0,
GPIO104_KP_MKOUT_1,
GPIO105_KP_MKOUT_2,

/* LCD */
GPIO58_LCD_LDD_0,
GPIO59_LCD_LDD_1,
GPIO60_LCD_LDD_2,
GPIO61_LCD_LDD_3,
GPIO62_LCD_LDD_4,
GPIO63_LCD_LDD_5,
GPIO64_LCD_LDD_6,
GPIO65_LCD_LDD_7,
GPIO66_LCD_LDD_8,
GPIO67_LCD_LDD_9,
GPIO68_LCD_LDD_10,
GPIO69_LCD_LDD_11,
GPIO70_LCD_LDD_12,
GPIO71_LCD_LDD_13,
GPIO72_LCD_LDD_14,
GPIO73_LCD_LDD_15,
GPIO74_LCD_FCLK,
GPIO75_LCD_LCLK,
GPIO76_LCD_PCLK,
GPIO77_LCD_BIAS,

/* MISC. */
GPIO10_GPIO, /* hotsync button */
GPIO12_GPIO, /* power detect */
GPIO107_GPIO, /* earphone detect */
};

/******************************************************************************
Expand All @@ -95,40 +139,58 @@ static int palmtx_mci_init(struct device *dev, irq_handler_t palmtx_detect_int,
int err = 0;

/* Setup an interrupt for detecting card insert/remove events */
err = request_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, palmtx_detect_int,
IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
err = gpio_request(GPIO_NR_PALMTX_SD_DETECT_N, "SD IRQ");
if (err)
goto err;
err = gpio_direction_input(GPIO_NR_PALMTX_SD_DETECT_N);
if (err)
goto err2;
err = request_irq(gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N),
palmtx_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
"SD/MMC card detect", data);
if (err) {
printk(KERN_ERR "%s: cannot request SD/MMC card detect IRQ\n",
__func__);
return err;
goto err2;
}

err = gpio_request(GPIO_NR_PALMTX_SD_POWER, "SD_POWER");
if (err)
goto pwr_err;
goto err3;
err = gpio_direction_output(GPIO_NR_PALMTX_SD_POWER, 0);
if (err)
goto err4;

err = gpio_request(GPIO_NR_PALMTX_SD_READONLY, "SD_READONLY");
if (err)
goto ro_err;
goto err4;
err = gpio_direction_input(GPIO_NR_PALMTX_SD_READONLY);
if (err)
goto err5;

printk(KERN_DEBUG "%s: irq registered\n", __func__);

return 0;

ro_err:
err5:
gpio_free(GPIO_NR_PALMTX_SD_READONLY);
err4:
gpio_free(GPIO_NR_PALMTX_SD_POWER);
pwr_err:
free_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, data);
err3:
free_irq(gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N), data);
err2:
gpio_free(GPIO_NR_PALMTX_SD_DETECT_N);
err:
return err;
}

static void palmtx_mci_exit(struct device *dev, void *data)
{
gpio_free(GPIO_NR_PALMTX_SD_READONLY);
gpio_free(GPIO_NR_PALMTX_SD_POWER);
free_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, data);
free_irq(gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N), data);
gpio_free(GPIO_NR_PALMTX_SD_DETECT_N);
}

static void palmtx_mci_power(struct device *dev, unsigned int vdd)
Expand Down Expand Up @@ -167,7 +229,6 @@ static unsigned int palmtx_matrix_keys[] = {

KEY(3, 0, KEY_RIGHT),
KEY(3, 2, KEY_LEFT),

};

static struct pxa27x_keypad_platform_data palmtx_keypad_platform_data = {
Expand Down Expand Up @@ -209,11 +270,19 @@ static int palmtx_backlight_init(struct device *dev)
ret = gpio_request(GPIO_NR_PALMTX_BL_POWER, "BL POWER");
if (ret)
goto err;
ret = gpio_direction_output(GPIO_NR_PALMTX_BL_POWER, 0);
if (ret)
goto err2;
ret = gpio_request(GPIO_NR_PALMTX_LCD_POWER, "LCD POWER");
if (ret)
goto err2;
ret = gpio_direction_output(GPIO_NR_PALMTX_LCD_POWER, 0);
if (ret)
goto err3;

return 0;
err3:
gpio_free(GPIO_NR_PALMTX_LCD_POWER);
err2:
gpio_free(GPIO_NR_PALMTX_BL_POWER);
err:
Expand Down Expand Up @@ -254,31 +323,45 @@ static struct platform_device palmtx_backlight = {
/******************************************************************************
* IrDA
******************************************************************************/
static int palmtx_irda_startup(struct device *dev)
{
int err;
err = gpio_request(GPIO_NR_PALMTX_IR_DISABLE, "IR DISABLE");
if (err)
goto err;
err = gpio_direction_output(GPIO_NR_PALMTX_IR_DISABLE, 1);
if (err)
gpio_free(GPIO_NR_PALMTX_IR_DISABLE);
err:
return err;
}

static void palmtx_irda_shutdown(struct device *dev)
{
gpio_free(GPIO_NR_PALMTX_IR_DISABLE);
}

static void palmtx_irda_transceiver_mode(struct device *dev, int mode)
{
gpio_set_value(GPIO_NR_PALMTX_IR_DISABLE, mode & IR_OFF);
pxa2xx_transceiver_mode(dev, mode);
}

static struct pxaficp_platform_data palmtx_ficp_platform_data = {
.startup = palmtx_irda_startup,
.shutdown = palmtx_irda_shutdown,
.transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
.transceiver_mode = palmtx_irda_transceiver_mode,
};

/******************************************************************************
* UDC
******************************************************************************/
static void palmtx_udc_command(int cmd)
{
gpio_set_value(GPIO_NR_PALMTX_USB_POWER, !cmd);
udelay(50);
gpio_set_value(GPIO_NR_PALMTX_USB_PULLUP, !cmd);
}

static struct pxa2xx_udc_mach_info palmtx_udc_info __initdata = {
.gpio_vbus = GPIO_NR_PALMTX_USB_DETECT_N,
.gpio_vbus_inverted = 1,
.udc_command = palmtx_udc_command,
.gpio_pullup = GPIO_NR_PALMTX_USB_POWER,
.gpio_pullup_inverted = 0,
};

/******************************************************************************
Expand All @@ -290,17 +373,16 @@ static int power_supply_init(struct device *dev)

ret = gpio_request(GPIO_NR_PALMTX_POWER_DETECT, "CABLE_STATE_AC");
if (ret)
goto err_cs_ac;

ret = gpio_request(GPIO_NR_PALMTX_USB_DETECT_N, "CABLE_STATE_USB");
goto err1;
ret = gpio_direction_input(GPIO_NR_PALMTX_POWER_DETECT);
if (ret)
goto err_cs_usb;
goto err2;

return 0;

err_cs_usb:
err2:
gpio_free(GPIO_NR_PALMTX_POWER_DETECT);
err_cs_ac:
err1:
return ret;
}

Expand All @@ -309,14 +391,8 @@ static int palmtx_is_ac_online(void)
return gpio_get_value(GPIO_NR_PALMTX_POWER_DETECT);
}

static int palmtx_is_usb_online(void)
{
return !gpio_get_value(GPIO_NR_PALMTX_USB_DETECT_N);
}

static void power_supply_exit(struct device *dev)
{
gpio_free(GPIO_NR_PALMTX_USB_DETECT_N);
gpio_free(GPIO_NR_PALMTX_POWER_DETECT);
}

Expand All @@ -327,7 +403,6 @@ static char *palmtx_supplicants[] = {
static struct pda_power_pdata power_supply_info = {
.init = power_supply_init,
.is_ac_online = palmtx_is_ac_online,
.is_usb_online = palmtx_is_usb_online,
.exit = power_supply_exit,
.supplied_to = palmtx_supplicants,
.num_supplicants = ARRAY_SIZE(palmtx_supplicants),
Expand Down Expand Up @@ -410,12 +485,23 @@ static void __init palmtx_map_io(void)
iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc));
}

/* setup udc GPIOs initial state */
static void __init palmtx_udc_init(void)
{
if (!gpio_request(GPIO_NR_PALMTX_USB_POWER, "UDC Vbus")) {
gpio_direction_output(GPIO_NR_PALMTX_USB_POWER, 1);
gpio_free(GPIO_NR_PALMTX_USB_POWER);
}
}


static void __init palmtx_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));

set_pxa_fb_info(&palmtx_lcd_screen);
pxa_set_mci_info(&palmtx_mci_platform_data);
palmtx_udc_init();
pxa_set_udc_info(&palmtx_udc_info);
pxa_set_ac97_info(NULL);
pxa_set_ficp_info(&palmtx_ficp_platform_data);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/pcm990-baseboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ static struct soc_camera_link iclink[] = {
.gpio = NR_BUILTIN_GPIO + 1,
}, {
.bus_id = 0, /* Must match with the camera ID above */
.gpio = -ENXIO,
}
};

Expand Down
5 changes: 3 additions & 2 deletions arch/arm/plat-omap/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
#define OMAP24XX_GPIO_IRQSTATUS2 0x0028
#define OMAP24XX_GPIO_IRQENABLE2 0x002c
#define OMAP24XX_GPIO_IRQENABLE1 0x001c
#define OMAP24XX_GPIO_WAKE_EN 0x0020
#define OMAP24XX_GPIO_CTRL 0x0030
#define OMAP24XX_GPIO_OE 0x0034
#define OMAP24XX_GPIO_DATAIN 0x0038
Expand Down Expand Up @@ -1551,7 +1552,7 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
#endif
#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
case METHOD_GPIO_24XX:
wake_status = bank->base + OMAP24XX_GPIO_SETWKUENA;
wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN;
wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA;
break;
Expand All @@ -1574,7 +1575,7 @@ static int omap_gpio_resume(struct sys_device *dev)
{
int i;

if (!cpu_is_omap24xx() && !cpu_is_omap16xx())
if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
return 0;

for (i = 0; i < gpio_bank_count; i++) {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-omap/include/mach/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void clk_deny_idle(struct clk *clk);
* clk_allow_idle - Counters previous clk_deny_idle
* @clk: clock signal handle
*/
void clk_deny_idle(struct clk *clk);
void clk_allow_idle(struct clk *clk);

extern void omap_pm_idle(void);
extern void omap_pm_suspend(void);
Expand Down
14 changes: 7 additions & 7 deletions drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ static int is_vbus_present(void)

if (mach->gpio_vbus) {
int value = gpio_get_value(mach->gpio_vbus);
return mach->gpio_vbus_inverted ? !value : value;

if (mach->gpio_vbus_inverted)
return !value;
else
return !!value;
}
if (mach->udc_is_connected)
return mach->udc_is_connected();
Expand Down Expand Up @@ -982,7 +986,7 @@ static int pxa25x_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
struct pxa25x_udc *udc;

udc = container_of(_gadget, struct pxa25x_udc, gadget);
udc->vbus = (is_active != 0);
udc->vbus = is_active;
DMSG("vbus %s\n", is_active ? "supplied" : "inactive");
pullup(udc);
return 0;
Expand Down Expand Up @@ -1399,12 +1403,8 @@ lubbock_vbus_irq(int irq, void *_dev)
static irqreturn_t udc_vbus_irq(int irq, void *_dev)
{
struct pxa25x_udc *dev = _dev;
int vbus = gpio_get_value(dev->mach->gpio_vbus);

if (dev->mach->gpio_vbus_inverted)
vbus = !vbus;

pxa25x_udc_vbus_session(&dev->gadget, vbus);
pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present());
return IRQ_HANDLED;
}

Expand Down
Loading

0 comments on commit 4ec8f07

Please sign in to comment.