Skip to content

Commit

Permalink
[ARM] 5095/2: pcm990: switch from pxa_gpio_mode to pxa2xx_mfp_config
Browse files Browse the repository at this point in the history
pxa_gpio_mode() is deprecated, use the new pxa2xx_mfp_config() function to
configure GPIOs in pcm990 platform code. Convert "array, ARRAY_SIZE(array)"
to "ARRAY_AND_SIZE(array)" while at it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Guennadi Liakhovetski authored and Russell King committed Jul 9, 2008
1 parent c0b8556 commit 6a566fb
Showing 1 changed file with 41 additions and 33 deletions.
74 changes: 41 additions & 33 deletions arch/arm/mach-pxa/pcm990-baseboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,30 @@
#include <asm/arch/camera.h>
#include <asm/mach/map.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/arch/audio.h>
#include <asm/arch/mmc.h>
#include <asm/arch/ohci.h>
#include <asm/arch/pcm990_baseboard.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/mfp-pxa27x.h>

#include "devices.h"
#include "generic.h"

static unsigned long pcm990_pin_config[] __initdata = {
/* MMC */
GPIO32_MMC_CLK,
GPIO112_MMC_CMD,
GPIO92_MMC_DAT_0,
GPIO109_MMC_DAT_1,
GPIO110_MMC_DAT_2,
GPIO111_MMC_DAT_3,
/* USB */
GPIO88_USBH1_PWR,
GPIO89_USBH1_PEN,
/* PWM0 */
GPIO16_PWM0_OUT,
};

/*
* pcm990_lcd_power - control power supply to the LCD
Expand Down Expand Up @@ -277,16 +293,6 @@ static int pcm990_mci_init(struct device *dev, irq_handler_t mci_detect_int,
{
int err;

/*
* enable GPIO for PXA27x MMC controller
*/
pxa_gpio_mode(GPIO32_MMCCLK_MD);
pxa_gpio_mode(GPIO112_MMCCMD_MD);
pxa_gpio_mode(GPIO92_MMCDAT0_MD);
pxa_gpio_mode(GPIO109_MMCDAT1_MD);
pxa_gpio_mode(GPIO110_MMCDAT2_MD);
pxa_gpio_mode(GPIO111_MMCDAT3_MD);

err = request_irq(PCM027_MMCDET_IRQ, mci_detect_int, IRQF_DISABLED,
"MMC card detect", data);
if (err)
Expand Down Expand Up @@ -333,8 +339,6 @@ static struct pxamci_platform_data pcm990_mci_platform_data = {
*/
static int pcm990_ohci_init(struct device *dev)
{
pxa_gpio_mode(PCM990_USB_OVERCURRENT);
pxa_gpio_mode(PCM990_USB_PWR_EN);
/*
* disable USB port 2 and 3
* power sense is active low
Expand All @@ -361,23 +365,27 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = {
* PXA27x Camera specific stuff
*/
#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
static unsigned long pcm990_camera_pin_config[] = {
/* CIF */
GPIO98_CIF_DD_0,
GPIO105_CIF_DD_1,
GPIO104_CIF_DD_2,
GPIO103_CIF_DD_3,
GPIO95_CIF_DD_4,
GPIO94_CIF_DD_5,
GPIO93_CIF_DD_6,
GPIO108_CIF_DD_7,
GPIO107_CIF_DD_8,
GPIO106_CIF_DD_9,
GPIO42_CIF_MCLK,
GPIO45_CIF_PCLK,
GPIO43_CIF_FV,
GPIO44_CIF_LV,
};

static int pcm990_pxacamera_init(struct device *dev)
{
pxa_gpio_mode(GPIO98_CIF_DD_0_MD);
pxa_gpio_mode(GPIO105_CIF_DD_1_MD);
pxa_gpio_mode(GPIO104_CIF_DD_2_MD);
pxa_gpio_mode(GPIO103_CIF_DD_3_MD);
pxa_gpio_mode(GPIO95_CIF_DD_4_MD);
pxa_gpio_mode(GPIO94_CIF_DD_5_MD);
pxa_gpio_mode(GPIO93_CIF_DD_6_MD);
pxa_gpio_mode(GPIO108_CIF_DD_7_MD);
pxa_gpio_mode(GPIO107_CIF_DD_8_MD);
pxa_gpio_mode(GPIO106_CIF_DD_9_MD);
pxa_gpio_mode(GPIO42_CIF_MCLK_MD);
pxa_gpio_mode(GPIO45_CIF_PCLK_MD);
pxa_gpio_mode(GPIO43_CIF_FV_MD);
pxa_gpio_mode(GPIO44_CIF_LV_MD);

pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
return 0;
}

Expand Down Expand Up @@ -449,16 +457,17 @@ static struct map_desc pcm990_io_desc[] __initdata = {
*/
void __init pcm990_baseboard_init(void)
{
pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_pin_config));

/* register CPLD access */
iotable_init(pcm990_io_desc, ARRAY_SIZE(pcm990_io_desc));
iotable_init(ARRAY_AND_SIZE(pcm990_io_desc));

/* register CPLD's IRQ controller */
pcm990_init_irq();

#ifndef CONFIG_PCM990_DISPLAY_NONE
set_pxa_fb_info(&pcm990_fbinfo);
#endif
pxa_gpio_mode(GPIO16_PWM0_MD);
platform_device_register(&pcm990_backlight_device);

/* MMC */
Expand All @@ -473,9 +482,8 @@ void __init pcm990_baseboard_init(void)
#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
pxa_set_camera_info(&pcm990_pxacamera_platform_data);

i2c_register_board_info(0, pcm990_i2c_devices,
ARRAY_SIZE(pcm990_i2c_devices));
i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
#endif

printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n");
printk(KERN_INFO "PCM-990 Evaluation baseboard initialized\n");
}

0 comments on commit 6a566fb

Please sign in to comment.