Again, a lot of platforms have changes in here: pxa, samsung, omap,
 at91, imx, ...
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIVAwUATwtZUmCrR//JCVInAQL93hAAzBbSkswA4SD09UXHPSLGpbWd7JYuax9T
 sR17FvnQCV+0T8c7ORRbjoBrCrxKkxuPMkFrfIHuTaP+beYe13CwTf2mV+dtnuv2
 hSjSjdgCq+yv+CvRZhRnmHqmEePN1dvRoC9Q/EVPEibJNJ4BjrTALMfkXbsTz861
 BOmcD7VGi0YfPhwRQ3D00MjohCflRoV2EmceHCUvH4HLEgpWcWl16UZeuWGn6BiA
 GJK37O2ubKz0hkExAH6NHEaRxeFsapjh8kkR8/dOoNh/iIlmmR5SRPOxMPWFD0ui
 lUeSc6QjMipHCzkfE7jUx6MICDZfRx+WRWVTwa/OTLJjJtY+zcRnUvoLl84XJqgX
 EG5YhyL+Os4Z0ci92uSK3rwYQ2AJz/r4dS6VWnAVVJHSc8zHCuioJL4KcF81llcz
 1dshlHkB1H1EeVrf08OM/1xX0X7SNzVJlQ801OZj31DYYtMqvrev72vn+tvJh6kL
 o9gZsOSl3cIlFi8cAK0WmZmwGHw4wfUDZb1ojN6GDctdrp/Vmwe3exHleWvfSDtN
 QBw4WyHl46JGw4bFVQ4hRH3vJZNuiso+ZNZvG3qGaEMfpNY5aMTy7lrxI/GFbFkA
 tEnhkDgjutEZ/B6nEF1h8cCrcLND7u4n209kJh6UR1Qx3a6xD/M/ycE4tisNuPE3
 wSSYuM1ZGTU=
 =vPhu
 -----END PGP SIGNATURE-----

Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Driver specific changes

Again, a lot of platforms have changes in here: pxa, samsung, omap,
at91, imx, ...

* tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (54 commits)
  ARM: sa1100: clean up of the clock support
  ARM: pxa: add dummy clock for sa1100-rtc
  RTC: sa1100: support sa1100, pxa and mmp soc families
  RTC: sa1100: remove redundant code of setting alarm
  RTC: sa1100: Clean out ost register
  Input: zylonite-wm97xx - replace IRQ_GPIO() with gpio_to_irq()
  pcmcia: pxa: replace IRQ_GPIO() with gpio_to_irq()
  ARM: EXYNOS: Modified files for SPI consolidation work
  ARM: S5P64X0: Enable SDHCI support
  ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names
  ARM: S5P64X0: Add HSMMC setup for host Controller
  ARM: EXYNOS: Add USB OHCI support to ORIGEN board
  USB: Add Samsung Exynos OHCI diver
  ARM: EXYNOS: Add USB OHCI support to SMDKV310 board
  ARM: EXYNOS: Add USB OHCI device
  net: macb: fix build break with !CONFIG_OF
  i2c: tegra: Support DVC controller in device tree
  i2c: tegra: Add __devinit/exit to probe/remove
  net/at91_ether: use gpio_is_valid for phy IRQ line
  ARM: at91/net: add macb ethernet controller in 9g45/9g20 DT
  ...
This commit is contained in:
Linus Torvalds 2012-01-09 14:39:22 -08:00
Родитель 5ede3ceb7b dcf7ec5ee6
Коммит 2ac9d7aacc
169 изменённых файлов: 3029 добавлений и 1650 удалений

Просмотреть файл

@ -0,0 +1,25 @@
* Cadence MACB/GEM Ethernet controller
Required properties:
- compatible: Should be "cdns,[<chip>-]{macb|gem}"
Use "cdns,at91sam9260-macb" Atmel at91sam9260 and at91sam9263 SoCs.
Use "cdns,at32ap7000-macb" for other 10/100 usage or use the generic form: "cdns,macb".
Use "cnds,pc302-gem" for Picochip picoXcell pc302 and later devices based on
the Cadence GEM, or the generic form: "cdns,gem".
- reg: Address and length of the register set for the device
- interrupts: Should contain macb interrupt
- phy-mode: String, operation mode of the PHY interface.
Supported values are: "mii", "rmii", "gmii", "rgmii".
Optional properties:
- local-mac-address: 6 bytes, mac address
Examples:
macb0: ethernet@fffc4000 {
compatible = "cdns,at32ap7000-macb";
reg = <0xfffc4000 0x4000>;
interrupts = <21>;
phy-mode = "rmii";
local-mac-address = [3a 0e 03 04 05 06];
};

Просмотреть файл

@ -597,6 +597,7 @@ config ARCH_MMP
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select CLKDEV_LOOKUP select CLKDEV_LOOKUP
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GPIO_PXA
select HAVE_SCHED_CLOCK select HAVE_SCHED_CLOCK
select TICK_ONESHOT select TICK_ONESHOT
select PLAT_PXA select PLAT_PXA
@ -682,6 +683,7 @@ config ARCH_PXA
select CLKSRC_MMIO select CLKSRC_MMIO
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GPIO_PXA
select HAVE_SCHED_CLOCK select HAVE_SCHED_CLOCK
select TICK_ONESHOT select TICK_ONESHOT
select PLAT_PXA select PLAT_PXA
@ -749,7 +751,7 @@ config ARCH_SA1100
select ARCH_HAS_CPUFREQ select ARCH_HAS_CPUFREQ
select CPU_FREQ select CPU_FREQ
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select HAVE_CLK select CLKDEV_LOOKUP
select HAVE_SCHED_CLOCK select HAVE_SCHED_CLOCK
select TICK_ONESHOT select TICK_ONESHOT
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB

Просмотреть файл

@ -114,6 +114,13 @@
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
}; };
macb0: ethernet@fffc4000 {
compatible = "cdns,at32ap7000-macb", "cdns,macb";
reg = <0xfffc4000 0x100>;
interrupts = <21>;
status = "disabled";
};
}; };
}; };
}; };

Просмотреть файл

@ -101,6 +101,13 @@
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
}; };
macb0: ethernet@fffbc000 {
compatible = "cdns,at32ap7000-macb", "cdns,macb";
reg = <0xfffbc000 0x100>;
interrupts = <25>;
status = "disabled";
};
}; };
}; };
}; };

Просмотреть файл

@ -30,6 +30,11 @@
usart1: serial@fff90000 { usart1: serial@fff90000 {
status = "okay"; status = "okay";
}; };
macb0: ethernet@fffbc000 {
phy-mode = "rmii";
status = "okay";
};
}; };
}; };
}; };

Просмотреть файл

@ -25,6 +25,11 @@
dbgu: serial@fffff200 { dbgu: serial@fffff200 {
status = "okay"; status = "okay";
}; };
macb0: ethernet@fffc4000 {
phy-mode = "rmii";
status = "okay";
};
}; };
}; };
}; };

Просмотреть файл

@ -89,6 +89,11 @@ config EXYNOS4_DEV_DWMCI
help help
Compile in platform device definitions for DWMCI Compile in platform device definitions for DWMCI
config EXYNOS4_DEV_USB_OHCI
bool
help
Compile in platform device definition for USB OHCI
config EXYNOS4_SETUP_I2C1 config EXYNOS4_SETUP_I2C1
bool bool
help help
@ -150,6 +155,11 @@ config EXYNOS4_SETUP_USB_PHY
help help
Common setup code for USB PHY controller Common setup code for USB PHY controller
config EXYNOS4_SETUP_SPI
bool
help
Common setup code for SPI GPIO configurations.
# machine support # machine support
if ARCH_EXYNOS4 if ARCH_EXYNOS4
@ -187,6 +197,7 @@ config MACH_SMDKV310
select EXYNOS4_DEV_DMA select EXYNOS4_DEV_DMA
select EXYNOS4_DEV_PD select EXYNOS4_DEV_PD
select SAMSUNG_DEV_PWM select SAMSUNG_DEV_PWM
select EXYNOS4_DEV_USB_OHCI
select EXYNOS4_DEV_SYSMMU select EXYNOS4_DEV_SYSMMU
select EXYNOS4_SETUP_FIMD0 select EXYNOS4_SETUP_FIMD0
select EXYNOS4_SETUP_I2C1 select EXYNOS4_SETUP_I2C1
@ -300,6 +311,7 @@ config MACH_ORIGEN
select SAMSUNG_DEV_PWM select SAMSUNG_DEV_PWM
select EXYNOS4_DEV_DMA select EXYNOS4_DEV_DMA
select EXYNOS4_DEV_PD select EXYNOS4_DEV_PD
select EXYNOS4_DEV_USB_OHCI
select EXYNOS4_SETUP_FIMD0 select EXYNOS4_SETUP_FIMD0
select EXYNOS4_SETUP_SDHCI select EXYNOS4_SETUP_SDHCI
select EXYNOS4_SETUP_USB_PHY select EXYNOS4_SETUP_USB_PHY

Просмотреть файл

@ -49,6 +49,7 @@ obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o
obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o
obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
obj-$(CONFIG_EXYNOS4_DEV_DMA) += dma.o obj-$(CONFIG_EXYNOS4_DEV_DMA) += dma.o
obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o
obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
@ -63,3 +64,4 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C7) += setup-i2c7.o
obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o
obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o
obj-$(CONFIG_EXYNOS4_SETUP_SPI) += setup-spi.o

Просмотреть файл

@ -1110,36 +1110,6 @@ static struct clksrc_clk clksrcs[] = {
.sources = &clkset_group, .sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_LCD0, .shift = 0, .size = 4 }, .reg_src = { .reg = S5P_CLKSRC_LCD0, .shift = 0, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 }, .reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 },
}, {
.clk = {
.name = "sclk_spi",
.devname = "s3c64xx-spi.0",
.enable = exynos4_clksrc_mask_peril1_ctrl,
.ctrlbit = (1 << 16),
},
.sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 },
}, {
.clk = {
.name = "sclk_spi",
.devname = "s3c64xx-spi.1",
.enable = exynos4_clksrc_mask_peril1_ctrl,
.ctrlbit = (1 << 20),
},
.sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 },
}, {
.clk = {
.name = "sclk_spi",
.devname = "s3c64xx-spi.2",
.enable = exynos4_clksrc_mask_peril1_ctrl,
.ctrlbit = (1 << 24),
},
.sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 },
}, { }, {
.clk = { .clk = {
.name = "sclk_fimg2d", .name = "sclk_fimg2d",
@ -1258,6 +1228,42 @@ static struct clksrc_clk clk_sclk_mmc3 = {
.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 }, .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
}; };
static struct clksrc_clk clk_sclk_spi0 = {
.clk = {
.name = "sclk_spi",
.devname = "s3c64xx-spi.0",
.enable = exynos4_clksrc_mask_peril1_ctrl,
.ctrlbit = (1 << 16),
},
.sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 },
};
static struct clksrc_clk clk_sclk_spi1 = {
.clk = {
.name = "sclk_spi",
.devname = "s3c64xx-spi.1",
.enable = exynos4_clksrc_mask_peril1_ctrl,
.ctrlbit = (1 << 20),
},
.sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 },
};
static struct clksrc_clk clk_sclk_spi2 = {
.clk = {
.name = "sclk_spi",
.devname = "s3c64xx-spi.2",
.enable = exynos4_clksrc_mask_peril1_ctrl,
.ctrlbit = (1 << 24),
},
.sources = &clkset_group,
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 },
.reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 },
};
/* Clock initialization code */ /* Clock initialization code */
static struct clksrc_clk *sysclks[] = { static struct clksrc_clk *sysclks[] = {
&clk_mout_apll, &clk_mout_apll,
@ -1306,6 +1312,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
&clk_sclk_mmc1, &clk_sclk_mmc1,
&clk_sclk_mmc2, &clk_sclk_mmc2,
&clk_sclk_mmc3, &clk_sclk_mmc3,
&clk_sclk_spi0,
&clk_sclk_spi1,
&clk_sclk_spi2,
}; };
static struct clk_lookup exynos4_clk_lookup[] = { static struct clk_lookup exynos4_clk_lookup[] = {
@ -1319,6 +1329,9 @@ static struct clk_lookup exynos4_clk_lookup[] = {
CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk), CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0), CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0),
CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1), CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1),
CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk0", &clk_sclk_spi0.clk),
CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk0", &clk_sclk_spi1.clk),
CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk0", &clk_sclk_spi2.clk),
}; };
static int xtal_rate; static int xtal_rate;

Просмотреть файл

@ -0,0 +1,52 @@
/* linux/arch/arm/mach-exynos/dev-ohci.c
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* EXYNOS - OHCI support
*
* 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/dma-mapping.h>
#include <linux/platform_device.h>
#include <mach/irqs.h>
#include <mach/map.h>
#include <mach/ohci.h>
#include <plat/devs.h>
#include <plat/usb-phy.h>
static struct resource exynos4_ohci_resource[] = {
[0] = DEFINE_RES_MEM(EXYNOS4_PA_OHCI, SZ_256),
[1] = DEFINE_RES_IRQ(IRQ_USB_HOST),
};
static u64 exynos4_ohci_dma_mask = DMA_BIT_MASK(32);
struct platform_device exynos4_device_ohci = {
.name = "exynos-ohci",
.id = -1,
.num_resources = ARRAY_SIZE(exynos4_ohci_resource),
.resource = exynos4_ohci_resource,
.dev = {
.dma_mask = &exynos4_ohci_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}
};
void __init exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd)
{
struct exynos4_ohci_platdata *npd;
npd = s3c_set_platdata(pd, sizeof(struct exynos4_ohci_platdata),
&exynos4_device_ohci);
if (!npd->phy_init)
npd->phy_init = s5p_usb_phy_init;
if (!npd->phy_exit)
npd->phy_exit = s5p_usb_phy_exit;
}

Просмотреть файл

@ -72,6 +72,9 @@
#define IRQ_IIC5 IRQ_SPI(63) #define IRQ_IIC5 IRQ_SPI(63)
#define IRQ_IIC6 IRQ_SPI(64) #define IRQ_IIC6 IRQ_SPI(64)
#define IRQ_IIC7 IRQ_SPI(65) #define IRQ_IIC7 IRQ_SPI(65)
#define IRQ_SPI0 IRQ_SPI(66)
#define IRQ_SPI1 IRQ_SPI(67)
#define IRQ_SPI2 IRQ_SPI(68)
#define IRQ_USB_HOST IRQ_SPI(70) #define IRQ_USB_HOST IRQ_SPI(70)
#define IRQ_USB_HSOTG IRQ_SPI(71) #define IRQ_USB_HSOTG IRQ_SPI(71)

Просмотреть файл

@ -87,6 +87,10 @@
#define EXYNOS4_PA_SYSMMU_TV 0x12E20000 #define EXYNOS4_PA_SYSMMU_TV 0x12E20000
#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000 #define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000
#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000 #define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000
#define EXYNOS4_PA_SPI0 0x13920000
#define EXYNOS4_PA_SPI1 0x13930000
#define EXYNOS4_PA_SPI2 0x13940000
#define EXYNOS4_PA_GPIO1 0x11400000 #define EXYNOS4_PA_GPIO1 0x11400000
#define EXYNOS4_PA_GPIO2 0x11000000 #define EXYNOS4_PA_GPIO2 0x11000000
@ -107,6 +111,7 @@
#define EXYNOS4_PA_SROMC 0x12570000 #define EXYNOS4_PA_SROMC 0x12570000
#define EXYNOS4_PA_EHCI 0x12580000 #define EXYNOS4_PA_EHCI 0x12580000
#define EXYNOS4_PA_OHCI 0x12590000
#define EXYNOS4_PA_HSPHY 0x125B0000 #define EXYNOS4_PA_HSPHY 0x125B0000
#define EXYNOS4_PA_MFC 0x13400000 #define EXYNOS4_PA_MFC 0x13400000
@ -148,6 +153,9 @@
#define S3C_PA_RTC EXYNOS4_PA_RTC #define S3C_PA_RTC EXYNOS4_PA_RTC
#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG #define S3C_PA_WDT EXYNOS4_PA_WATCHDOG
#define S3C_PA_UART EXYNOS4_PA_UART #define S3C_PA_UART EXYNOS4_PA_UART
#define S3C_PA_SPI0 EXYNOS4_PA_SPI0
#define S3C_PA_SPI1 EXYNOS4_PA_SPI1
#define S3C_PA_SPI2 EXYNOS4_PA_SPI2
#define S5P_PA_EHCI EXYNOS4_PA_EHCI #define S5P_PA_EHCI EXYNOS4_PA_EHCI
#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0 #define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0

Просмотреть файл

@ -0,0 +1,21 @@
/*
* Copyright (C) 2011 Samsung Electronics Co.Ltd
* http://www.samsung.com/
*
* 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.
*/
#ifndef __MACH_EXYNOS_OHCI_H
#define __MACH_EXYNOS_OHCI_H
struct exynos4_ohci_platdata {
int (*phy_init)(struct platform_device *pdev, int type);
int (*phy_exit)(struct platform_device *pdev, int type);
};
extern void exynos4_ohci_set_platdata(struct exynos4_ohci_platdata *pd);
#endif /* __MACH_EXYNOS_OHCI_H */

Просмотреть файл

@ -0,0 +1,16 @@
/* linux/arch/arm/mach-exynos4/include/mach/spi-clocks.h
*
* Copyright (C) 2011 Samsung Electronics Co. Ltd.
*
* 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.
*/
#ifndef __ASM_ARCH_SPI_CLKS_H
#define __ASM_ARCH_SPI_CLKS_H __FILE__
/* Must source from SCLK_SPI */
#define EXYNOS4_SPI_SRCCLK_SCLK 0
#endif /* __ASM_ARCH_SPI_CLKS_H */

Просмотреть файл

@ -41,6 +41,7 @@
#include <plat/fb.h> #include <plat/fb.h>
#include <plat/mfc.h> #include <plat/mfc.h>
#include <mach/ohci.h>
#include <mach/map.h> #include <mach/map.h>
#include "common.h" #include "common.h"
@ -485,6 +486,16 @@ static void __init origen_ehci_init(void)
s5p_ehci_set_platdata(pdata); s5p_ehci_set_platdata(pdata);
} }
/* USB OHCI */
static struct exynos4_ohci_platdata origen_ohci_pdata;
static void __init origen_ohci_init(void)
{
struct exynos4_ohci_platdata *pdata = &origen_ohci_pdata;
exynos4_ohci_set_platdata(pdata);
}
static struct gpio_keys_button origen_gpio_keys_table[] = { static struct gpio_keys_button origen_gpio_keys_table[] = {
{ {
.code = KEY_MENU, .code = KEY_MENU,
@ -608,6 +619,7 @@ static struct platform_device *origen_devices[] __initdata = {
&s5p_device_mfc_l, &s5p_device_mfc_l,
&s5p_device_mfc_r, &s5p_device_mfc_r,
&s5p_device_mixer, &s5p_device_mixer,
&exynos4_device_ohci,
&exynos4_device_pd[PD_LCD0], &exynos4_device_pd[PD_LCD0],
&exynos4_device_pd[PD_TV], &exynos4_device_pd[PD_TV],
&exynos4_device_pd[PD_G3D], &exynos4_device_pd[PD_G3D],
@ -672,6 +684,7 @@ static void __init origen_machine_init(void)
s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata); s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata);
origen_ehci_init(); origen_ehci_init();
origen_ohci_init();
clk_xusbxti.rate = 24000000; clk_xusbxti.rate = 24000000;
s5p_tv_setup(); s5p_tv_setup();

Просмотреть файл

@ -42,6 +42,7 @@
#include <plat/clock.h> #include <plat/clock.h>
#include <mach/map.h> #include <mach/map.h>
#include <mach/ohci.h>
#include "common.h" #include "common.h"
@ -245,6 +246,16 @@ static void __init smdkv310_ehci_init(void)
s5p_ehci_set_platdata(pdata); s5p_ehci_set_platdata(pdata);
} }
/* USB OHCI */
static struct exynos4_ohci_platdata smdkv310_ohci_pdata;
static void __init smdkv310_ohci_init(void)
{
struct exynos4_ohci_platdata *pdata = &smdkv310_ohci_pdata;
exynos4_ohci_set_platdata(pdata);
}
static struct platform_device *smdkv310_devices[] __initdata = { static struct platform_device *smdkv310_devices[] __initdata = {
&s3c_device_hsmmc0, &s3c_device_hsmmc0,
&s3c_device_hsmmc1, &s3c_device_hsmmc1,
@ -261,6 +272,7 @@ static struct platform_device *smdkv310_devices[] __initdata = {
&s5p_device_fimc3, &s5p_device_fimc3,
&exynos4_device_ac97, &exynos4_device_ac97,
&exynos4_device_i2s0, &exynos4_device_i2s0,
&exynos4_device_ohci,
&samsung_device_keypad, &samsung_device_keypad,
&s5p_device_mfc, &s5p_device_mfc,
&s5p_device_mfc_l, &s5p_device_mfc_l,
@ -363,6 +375,7 @@ static void __init smdkv310_machine_init(void)
s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata); s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata);
smdkv310_ehci_init(); smdkv310_ehci_init();
smdkv310_ohci_init();
clk_xusbxti.rate = 24000000; clk_xusbxti.rate = 24000000;
platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices)); platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));

Просмотреть файл

@ -0,0 +1,72 @@
/* linux/arch/arm/mach-exynos4/setup-spi.c
*
* Copyright (C) 2011 Samsung Electronics Ltd.
* http://www.samsung.com/
*
* 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/gpio.h>
#include <linux/platform_device.h>
#include <plat/gpio-cfg.h>
#include <plat/s3c64xx-spi.h>
#ifdef CONFIG_S3C64XX_DEV_SPI0
struct s3c64xx_spi_info s3c64xx_spi0_pdata __initdata = {
.fifo_lvl_mask = 0x1ff,
.rx_lvl_offset = 15,
.high_speed = 1,
.clk_from_cmu = true,
.tx_st_done = 25,
};
int s3c64xx_spi0_cfg_gpio(struct platform_device *dev)
{
s3c_gpio_cfgpin(EXYNOS4_GPB(0), S3C_GPIO_SFN(2));
s3c_gpio_setpull(EXYNOS4_GPB(0), S3C_GPIO_PULL_UP);
s3c_gpio_cfgall_range(EXYNOS4_GPB(2), 2,
S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
return 0;
}
#endif
#ifdef CONFIG_S3C64XX_DEV_SPI1
struct s3c64xx_spi_info s3c64xx_spi1_pdata __initdata = {
.fifo_lvl_mask = 0x7f,
.rx_lvl_offset = 15,
.high_speed = 1,
.clk_from_cmu = true,
.tx_st_done = 25,
};
int s3c64xx_spi1_cfg_gpio(struct platform_device *dev)
{
s3c_gpio_cfgpin(EXYNOS4_GPB(4), S3C_GPIO_SFN(2));
s3c_gpio_setpull(EXYNOS4_GPB(4), S3C_GPIO_PULL_UP);
s3c_gpio_cfgall_range(EXYNOS4_GPB(6), 2,
S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
return 0;
}
#endif
#ifdef CONFIG_S3C64XX_DEV_SPI2
struct s3c64xx_spi_info s3c64xx_spi2_pdata __initdata = {
.fifo_lvl_mask = 0x7f,
.rx_lvl_offset = 15,
.high_speed = 1,
.clk_from_cmu = true,
.tx_st_done = 25,
};
int s3c64xx_spi2_cfg_gpio(struct platform_device *dev)
{
s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_SFN(5));
s3c_gpio_setpull(EXYNOS4_GPC1(1), S3C_GPIO_PULL_UP);
s3c_gpio_cfgall_range(EXYNOS4_GPC1(3), 2,
S3C_GPIO_SFN(5), S3C_GPIO_PULL_UP);
return 0;
}
#endif

Просмотреть файл

@ -19,6 +19,13 @@
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/usb-phy.h> #include <plat/usb-phy.h>
static atomic_t host_usage;
static int exynos4_usb_host_phy_is_on(void)
{
return (readl(EXYNOS4_PHYPWR) & PHY1_STD_ANALOG_POWERDOWN) ? 0 : 1;
}
static int exynos4_usb_phy1_init(struct platform_device *pdev) static int exynos4_usb_phy1_init(struct platform_device *pdev)
{ {
struct clk *otg_clk; struct clk *otg_clk;
@ -27,6 +34,8 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
u32 rstcon; u32 rstcon;
int err; int err;
atomic_inc(&host_usage);
otg_clk = clk_get(&pdev->dev, "otg"); otg_clk = clk_get(&pdev->dev, "otg");
if (IS_ERR(otg_clk)) { if (IS_ERR(otg_clk)) {
dev_err(&pdev->dev, "Failed to get otg clock\n"); dev_err(&pdev->dev, "Failed to get otg clock\n");
@ -39,6 +48,9 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
return err; return err;
} }
if (exynos4_usb_host_phy_is_on())
return 0;
writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE, writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE,
S5P_USBHOST_PHY_CONTROL); S5P_USBHOST_PHY_CONTROL);
@ -95,6 +107,9 @@ static int exynos4_usb_phy1_exit(struct platform_device *pdev)
struct clk *otg_clk; struct clk *otg_clk;
int err; int err;
if (atomic_dec_return(&host_usage) > 0)
return 0;
otg_clk = clk_get(&pdev->dev, "otg"); otg_clk = clk_get(&pdev->dev, "otg");
if (IS_ERR(otg_clk)) { if (IS_ERR(otg_clk)) {
dev_err(&pdev->dev, "Failed to get otg clock\n"); dev_err(&pdev->dev, "Failed to get otg clock\n");

Просмотреть файл

@ -120,8 +120,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(27), .start = MMP_GPIO_TO_IRQ(27),
.end = gpio_to_irq(27), .end = MMP_GPIO_TO_IRQ(27),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
} }
}; };
@ -232,6 +232,7 @@ static void __init common_init(void)
pxa168_add_nand(&aspenite_nand_info); pxa168_add_nand(&aspenite_nand_info);
pxa168_add_fb(&aspenite_lcd_info); pxa168_add_fb(&aspenite_lcd_info);
pxa168_add_keypad(&aspenite_keypad_info); pxa168_add_keypad(&aspenite_keypad_info);
platform_device_register(&pxa168_device_gpio);
/* off-chip devices */ /* off-chip devices */
platform_device_register(&smc91x_device); platform_device_register(&smc91x_device);

Просмотреть файл

@ -38,6 +38,7 @@ static void __init avengers_lite_init(void)
/* on-chip devices */ /* on-chip devices */
pxa168_add_uart(2); pxa168_add_uart(2);
platform_device_register(&pxa168_device_gpio);
} }
MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform") MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")

Просмотреть файл

@ -202,6 +202,7 @@ static void __init brownstone_init(void)
/* on-chip devices */ /* on-chip devices */
mmp2_add_uart(1); mmp2_add_uart(1);
mmp2_add_uart(3); mmp2_add_uart(3);
platform_device_register(&mmp2_device_gpio);
mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */ mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */

Просмотреть файл

@ -87,8 +87,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(155), .start = MMP_GPIO_TO_IRQ(155),
.end = gpio_to_irq(155), .end = MMP_GPIO_TO_IRQ(155),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
} }
}; };
@ -110,6 +110,7 @@ static void __init flint_init(void)
/* on-chip devices */ /* on-chip devices */
mmp2_add_uart(1); mmp2_add_uart(1);
mmp2_add_uart(2); mmp2_add_uart(2);
platform_device_register(&mmp2_device_gpio);
/* off-chip devices */ /* off-chip devices */
platform_device_register(&smc91x_device); platform_device_register(&smc91x_device);

Просмотреть файл

@ -184,6 +184,7 @@ static void __init gplugd_init(void)
pxa168_add_uart(3); pxa168_add_uart(3);
pxa168_add_ssp(1); pxa168_add_ssp(1);
pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
platform_device_register(&pxa168_device_gpio);
pxa168_add_eth(&gplugd_eth_platform_data); pxa168_add_eth(&gplugd_eth_platform_data);
} }

Просмотреть файл

@ -2,6 +2,7 @@
#define __ASM_MACH_GPIO_PXA_H #define __ASM_MACH_GPIO_PXA_H
#include <mach/addr-map.h> #include <mach/addr-map.h>
#include <mach/cputype.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000) #define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
@ -9,8 +10,6 @@
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
#define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x))) #define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
#define NR_BUILTIN_GPIO IRQ_GPIO_NUM
#define gpio_to_bank(gpio) ((gpio) >> 5) #define gpio_to_bank(gpio) ((gpio) >> 5)
/* NOTE: these macros are defined here to make optimization of /* NOTE: these macros are defined here to make optimization of

Просмотреть файл

@ -3,11 +3,6 @@
#include <asm-generic/gpio.h> #include <asm-generic/gpio.h>
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio)) #include <mach/cputype.h>
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
#define __gpio_is_inverted(gpio) (0)
#define __gpio_is_occupied(gpio) (0)
#include <plat/gpio.h>
#endif /* __ASM_MACH_GPIO_H */ #endif /* __ASM_MACH_GPIO_H */

Просмотреть файл

@ -219,10 +219,10 @@
#define IRQ_MMP2_MUX_END (IRQ_MMP2_SSP_BASE + 2) #define IRQ_MMP2_MUX_END (IRQ_MMP2_SSP_BASE + 2)
#define IRQ_GPIO_START 128 #define IRQ_GPIO_START 128
#define IRQ_GPIO_NUM 192 #define MMP_NR_BUILTIN_GPIO 192
#define IRQ_GPIO(x) (IRQ_GPIO_START + (x)) #define MMP_GPIO_TO_IRQ(gpio) (IRQ_GPIO_START + (gpio))
#define IRQ_BOARD_START (IRQ_GPIO_START + IRQ_GPIO_NUM) #define IRQ_BOARD_START (IRQ_GPIO_START + MMP_NR_BUILTIN_GPIO)
#define NR_IRQS (IRQ_BOARD_START) #define NR_IRQS (IRQ_BOARD_START)

Просмотреть файл

@ -32,6 +32,8 @@ extern struct pxa_device_desc mmp2_device_sdh3;
extern struct pxa_device_desc mmp2_device_asram; extern struct pxa_device_desc mmp2_device_asram;
extern struct pxa_device_desc mmp2_device_isram; extern struct pxa_device_desc mmp2_device_isram;
extern struct platform_device mmp2_device_gpio;
static inline int mmp2_add_uart(int id) static inline int mmp2_add_uart(int id)
{ {
struct pxa_device_desc *d = NULL; struct pxa_device_desc *d = NULL;

Просмотреть файл

@ -43,6 +43,8 @@ struct pxa168_usb_pdata {
/* pdata can be NULL */ /* pdata can be NULL */
int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata); int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata);
extern struct platform_device pxa168_device_gpio;
static inline int pxa168_add_uart(int id) static inline int pxa168_add_uart(int id)
{ {
struct pxa_device_desc *d = NULL; struct pxa_device_desc *d = NULL;

Просмотреть файл

@ -21,6 +21,8 @@ extern struct pxa_device_desc pxa910_device_pwm3;
extern struct pxa_device_desc pxa910_device_pwm4; extern struct pxa_device_desc pxa910_device_pwm4;
extern struct pxa_device_desc pxa910_device_nand; extern struct pxa_device_desc pxa910_device_nand;
extern struct platform_device pxa910_device_gpio;
static inline int pxa910_add_uart(int id) static inline int pxa910_add_uart(int id)
{ {
struct pxa_device_desc *d = NULL; struct pxa_device_desc *d = NULL;

Просмотреть файл

@ -13,6 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/platform_device.h>
#include <asm/hardware/cache-tauros2.h> #include <asm/hardware/cache-tauros2.h>
@ -24,7 +25,6 @@
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/mfp.h> #include <mach/mfp.h>
#include <mach/gpio-pxa.h>
#include <mach/devices.h> #include <mach/devices.h>
#include <mach/mmp2.h> #include <mach/mmp2.h>
@ -33,8 +33,6 @@
#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c)
static struct mfp_addr_map mmp2_addr_map[] __initdata = { static struct mfp_addr_map mmp2_addr_map[] __initdata = {
MFP_ADDR_X(GPIO0, GPIO58, 0x54), MFP_ADDR_X(GPIO0, GPIO58, 0x54),
@ -95,24 +93,9 @@ void mmp2_clear_pmic_int(void)
__raw_writel(data, mfpr_pmic); __raw_writel(data, mfpr_pmic);
} }
static void __init mmp2_init_gpio(void)
{
int i;
/* enable GPIO clock */
__raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_MMP2_GPIO);
/* unmask GPIO edge detection for all 6 banks -- APMASKx */
for (i = 0; i < 6; i++)
__raw_writel(0xffffffff, APMASK(i));
pxa_init_gpio(IRQ_MMP2_GPIO, 0, 167, NULL);
}
void __init mmp2_init_irq(void) void __init mmp2_init_irq(void)
{ {
mmp2_init_icu(); mmp2_init_icu();
mmp2_init_gpio();
} }
static void sdhc_clk_enable(struct clk *clk) static void sdhc_clk_enable(struct clk *clk)
@ -149,6 +132,7 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000); static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
static APBC_CLK(gpio, MMP2_GPIO, 0, 26000000);
static APMU_CLK(nand, NAND, 0xbf, 100000000); static APMU_CLK(nand, NAND, 0xbf, 100000000);
static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops); static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops);
@ -168,6 +152,7 @@ static struct clk_lookup mmp2_clkregs[] = {
INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL),
INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"), INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"),
INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"), INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"),
INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"), INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"),
@ -230,3 +215,21 @@ MMP2_DEVICE(asram, "asram", -1, NONE, 0xe0000000, 0x4000);
/* 0xd1000000 ~ 0xd101ffff is reserved for secure processor */ /* 0xd1000000 ~ 0xd101ffff is reserved for secure processor */
MMP2_DEVICE(isram, "isram", -1, NONE, 0xd1020000, 0x18000); MMP2_DEVICE(isram, "isram", -1, NONE, 0xd1020000, 0x18000);
struct resource mmp2_resource_gpio[] = {
{
.start = 0xd4019000,
.end = 0xd4019fff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_MMP2_GPIO,
.end = IRQ_MMP2_GPIO,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device mmp2_device_gpio = {
.name = "pxa-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(mmp2_resource_gpio),
.resource = mmp2_resource_gpio,
};

Просмотреть файл

@ -13,6 +13,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/platform_device.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <mach/addr-map.h> #include <mach/addr-map.h>
@ -20,7 +21,6 @@
#include <mach/regs-apbc.h> #include <mach/regs-apbc.h>
#include <mach/regs-apmu.h> #include <mach/regs-apmu.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/gpio-pxa.h>
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/devices.h> #include <mach/devices.h>
#include <mach/mfp.h> #include <mach/mfp.h>
@ -43,26 +43,9 @@ static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata =
MFP_ADDR_END, MFP_ADDR_END,
}; };
#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
static void __init pxa168_init_gpio(void)
{
int i;
/* enable GPIO clock */
__raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA168_GPIO);
/* unmask GPIO edge detection for all 4 banks - APMASKx */
for (i = 0; i < 4; i++)
__raw_writel(0xffffffff, APMASK(i));
pxa_init_gpio(IRQ_PXA168_GPIOX, 0, 127, NULL);
}
void __init pxa168_init_irq(void) void __init pxa168_init_irq(void)
{ {
icu_init_irq(); icu_init_irq();
pxa168_init_gpio();
} }
/* APB peripheral clocks */ /* APB peripheral clocks */
@ -80,6 +63,7 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0);
static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); static APBC_CLK(ssp3, PXA168_SSP3, 4, 0);
static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); static APBC_CLK(ssp4, PXA168_SSP4, 4, 0);
static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); static APBC_CLK(ssp5, PXA168_SSP5, 4, 0);
static APBC_CLK(gpio, PXA168_GPIO, 0, 13000000);
static APBC_CLK(keypad, PXA168_KPC, 0, 32000); static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
static APMU_CLK(nand, NAND, 0x19b, 156000000); static APMU_CLK(nand, NAND, 0x19b, 156000000);
@ -105,6 +89,7 @@ static struct clk_lookup pxa168_clkregs[] = {
INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"),
@ -174,6 +159,25 @@ PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);
struct resource pxa168_resource_gpio[] = {
{
.start = 0xd4019000,
.end = 0xd4019fff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_PXA168_GPIOX,
.end = IRQ_PXA168_GPIOX,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device pxa168_device_gpio = {
.name = "pxa-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(pxa168_resource_gpio),
.resource = pxa168_resource_gpio,
};
struct resource pxa168_usb_host_resources[] = { struct resource pxa168_usb_host_resources[] = {
/* USB Host conroller register base */ /* USB Host conroller register base */
[0] = { [0] = {

Просмотреть файл

@ -12,6 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/platform_device.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <mach/addr-map.h> #include <mach/addr-map.h>
@ -19,7 +20,6 @@
#include <mach/regs-apmu.h> #include <mach/regs-apmu.h>
#include <mach/cputype.h> #include <mach/cputype.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/gpio-pxa.h>
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/mfp.h> #include <mach/mfp.h>
#include <mach/devices.h> #include <mach/devices.h>
@ -77,26 +77,9 @@ static struct mfp_addr_map pxa910_mfp_addr_map[] __initdata =
MFP_ADDR_END, MFP_ADDR_END,
}; };
#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
static void __init pxa910_init_gpio(void)
{
int i;
/* enable GPIO clock */
__raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA910_GPIO);
/* unmask GPIO edge detection for all 4 banks - APMASKx */
for (i = 0; i < 4; i++)
__raw_writel(0xffffffff, APMASK(i));
pxa_init_gpio(IRQ_PXA910_AP_GPIO, 0, 127, NULL);
}
void __init pxa910_init_irq(void) void __init pxa910_init_irq(void)
{ {
icu_init_irq(); icu_init_irq();
pxa910_init_gpio();
} }
/* APB peripheral clocks */ /* APB peripheral clocks */
@ -108,6 +91,7 @@ static APBC_CLK(pwm1, PXA910_PWM1, 1, 13000000);
static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000);
static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000);
static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000);
static APBC_CLK(gpio, PXA910_GPIO, 0, 13000000);
static APMU_CLK(nand, NAND, 0x19b, 156000000); static APMU_CLK(nand, NAND, 0x19b, 156000000);
static APMU_CLK(u2o, USB, 0x1b, 480000000); static APMU_CLK(u2o, USB, 0x1b, 480000000);
@ -123,6 +107,7 @@ static struct clk_lookup pxa910_clkregs[] = {
INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL),
INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"),
}; };
@ -179,3 +164,22 @@ PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10);
PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99); PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
struct resource pxa910_resource_gpio[] = {
{
.start = 0xd4019000,
.end = 0xd4019fff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_PXA910_AP_GPIO,
.end = IRQ_PXA910_AP_GPIO,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device pxa910_device_gpio = {
.name = "pxa-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(pxa910_resource_gpio),
.resource = pxa910_resource_gpio,
};

Просмотреть файл

@ -19,6 +19,7 @@
#include <mach/addr-map.h> #include <mach/addr-map.h>
#include <mach/mfp-pxa910.h> #include <mach/mfp-pxa910.h>
#include <mach/pxa910.h> #include <mach/pxa910.h>
#include <mach/irqs.h>
#include "common.h" #include "common.h"
@ -71,8 +72,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(80), .start = MMP_GPIO_TO_IRQ(80),
.end = gpio_to_irq(80), .end = MMP_GPIO_TO_IRQ(80),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
} }
}; };
@ -93,6 +94,7 @@ static void __init tavorevb_init(void)
/* on-chip devices */ /* on-chip devices */
pxa910_add_uart(1); pxa910_add_uart(1);
platform_device_register(&pxa910_device_gpio);
/* off-chip devices */ /* off-chip devices */
platform_device_register(&smc91x_device); platform_device_register(&smc91x_device);

Просмотреть файл

@ -66,7 +66,7 @@ static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
static struct i2c_board_info teton_bga_i2c_info[] __initdata = { static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
{ {
I2C_BOARD_INFO("ds1337", 0x68), I2C_BOARD_INFO("ds1337", 0x68),
.irq = gpio_to_irq(RTC_INT_GPIO) .irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO)
}, },
}; };
@ -78,6 +78,7 @@ static void __init teton_bga_init(void)
pxa168_add_uart(1); pxa168_add_uart(1);
pxa168_add_keypad(&teton_bga_keypad_info); pxa168_add_keypad(&teton_bga_keypad_info);
pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info)); pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
platform_device_register(&pxa168_device_gpio);
} }
MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform") MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")

Просмотреть файл

@ -24,12 +24,13 @@
#include <mach/addr-map.h> #include <mach/addr-map.h>
#include <mach/mfp-pxa910.h> #include <mach/mfp-pxa910.h>
#include <mach/pxa910.h> #include <mach/pxa910.h>
#include <mach/irqs.h>
#include "common.h" #include "common.h"
#define TTCDKB_GPIO_EXT0(x) (NR_BUILTIN_GPIO + ((x < 0) ? 0 : \ #define TTCDKB_GPIO_EXT0(x) (MMP_NR_BUILTIN_GPIO + ((x < 0) ? 0 : \
((x < 16) ? x : 15))) ((x < 16) ? x : 15)))
#define TTCDKB_GPIO_EXT1(x) (NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \ #define TTCDKB_GPIO_EXT1(x) (MMP_NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 : \
((x < 16) ? x : 15))) ((x < 16) ? x : 15)))
/* /*
@ -122,6 +123,7 @@ static struct platform_device ttc_dkb_device_onenand = {
}; };
static struct platform_device *ttc_dkb_devices[] = { static struct platform_device *ttc_dkb_devices[] = {
&pxa910_device_gpio,
&ttc_dkb_device_onenand, &ttc_dkb_device_onenand,
}; };
@ -136,7 +138,7 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
{ {
.type = "max7312", .type = "max7312",
.addr = 0x23, .addr = 0x23,
.irq = IRQ_GPIO(80), .irq = MMP_GPIO_TO_IRQ(80),
.platform_data = &max7312_data, .platform_data = &max7312_data,
}, },
}; };

Просмотреть файл

@ -22,6 +22,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <linux/spinlock.h>
#include <asm/clkdev.h> #include <asm/clkdev.h>
#include <asm/div64.h> #include <asm/div64.h>
@ -29,6 +30,7 @@
#include <mach/mx28.h> #include <mach/mx28.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/clock.h> #include <mach/clock.h>
#include <mach/digctl.h>
#include "regs-clkctrl-mx28.h" #include "regs-clkctrl-mx28.h"
@ -43,6 +45,33 @@ static struct clk emi_clk;
static struct clk saif0_clk; static struct clk saif0_clk;
static struct clk saif1_clk; static struct clk saif1_clk;
static struct clk clk32k_clk; static struct clk clk32k_clk;
static DEFINE_SPINLOCK(clkmux_lock);
/*
* HW_SAIF_CLKMUX_SEL:
* DIRECT(0x0): SAIF0 clock pins selected for SAIF0 input clocks, and SAIF1
* clock pins selected for SAIF1 input clocks.
* CROSSINPUT(0x1): SAIF1 clock inputs selected for SAIF0 input clocks, and
* SAIF0 clock inputs selected for SAIF1 input clocks.
* EXTMSTR0(0x2): SAIF0 clock pin selected for both SAIF0 and SAIF1 input
* clocks.
* EXTMSTR1(0x3): SAIF1 clock pin selected for both SAIF0 and SAIF1 input
* clocks.
*/
int mxs_saif_clkmux_select(unsigned int clkmux)
{
if (clkmux > 0x3)
return -EINVAL;
spin_lock(&clkmux_lock);
__raw_writel(BM_DIGCTL_CTRL_SAIF_CLKMUX,
DIGCTRL_BASE_ADDR + HW_DIGCTL_CTRL + MXS_CLR_ADDR);
__raw_writel(clkmux << BP_DIGCTL_CTRL_SAIF_CLKMUX,
DIGCTRL_BASE_ADDR + HW_DIGCTL_CTRL + MXS_SET_ADDR);
spin_unlock(&clkmux_lock);
return 0;
}
static int _raw_clk_enable(struct clk *clk) static int _raw_clk_enable(struct clk *clk)
{ {
@ -785,6 +814,15 @@ int __init mx28_clocks_init(void)
clk_set_parent(&saif0_clk, &pll0_clk); clk_set_parent(&saif0_clk, &pll0_clk);
clk_set_parent(&saif1_clk, &pll0_clk); clk_set_parent(&saif1_clk, &pll0_clk);
/*
* Set an initial clock rate for the saif internal logic to work
* properly. This is important when working in EXTMASTER mode that
* uses the other saif's BITCLK&LRCLK but it still needs a basic
* clock which should be fast enough for the internal logic.
*/
clk_set_rate(&saif0_clk, 24000000);
clk_set_rate(&saif1_clk, 24000000);
clkdev_add_table(lookups, ARRAY_SIZE(lookups)); clkdev_add_table(lookups, ARRAY_SIZE(lookups));
mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0); mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0);

Просмотреть файл

@ -47,6 +47,7 @@ struct platform_device *__init mx28_add_mxsfb(
const struct mxsfb_platform_data *pdata); const struct mxsfb_platform_data *pdata);
extern const struct mxs_saif_data mx28_saif_data[] __initconst; extern const struct mxs_saif_data mx28_saif_data[] __initconst;
#define mx28_add_saif(id) mxs_add_saif(&mx28_saif_data[id]) #define mx28_add_saif(id, pdata) \
mxs_add_saif(&mx28_saif_data[id], pdata)
struct platform_device *__init mx28_add_rtc_stmp3xxx(void); struct platform_device *__init mx28_add_rtc_stmp3xxx(void);

Просмотреть файл

@ -32,7 +32,8 @@ const struct mxs_saif_data mx28_saif_data[] __initconst = {
}; };
#endif #endif
struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data) struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data,
const struct mxs_saif_platform_data *pdata)
{ {
struct resource res[] = { struct resource res[] = {
{ {
@ -56,5 +57,5 @@ struct platform_device *__init mxs_add_saif(const struct mxs_saif_data *data)
}; };
return mxs_add_platform_device("mxs-saif", data->id, res, return mxs_add_platform_device("mxs-saif", data->id, res,
ARRAY_SIZE(res), NULL, 0); ARRAY_SIZE(res), pdata, sizeof(*pdata));
} }

Просмотреть файл

@ -17,6 +17,7 @@ extern const u32 *mxs_get_ocotp(void);
extern int mxs_reset_block(void __iomem *); extern int mxs_reset_block(void __iomem *);
extern void mxs_timer_init(struct clk *, int); extern void mxs_timer_init(struct clk *, int);
extern void mxs_restart(char, const char *); extern void mxs_restart(char, const char *);
extern int mxs_saif_clkmux_select(unsigned int clkmux);
extern int mx23_register_gpios(void); extern int mx23_register_gpios(void);
extern int mx23_clocks_init(void); extern int mx23_clocks_init(void);

Просмотреть файл

@ -94,6 +94,7 @@ struct platform_device *__init mxs_add_mxs_pwm(
resource_size_t iobase, int id); resource_size_t iobase, int id);
/* saif */ /* saif */
#include <sound/saif.h>
struct mxs_saif_data { struct mxs_saif_data {
int id; int id;
resource_size_t iobase; resource_size_t iobase;
@ -103,4 +104,5 @@ struct mxs_saif_data {
}; };
struct platform_device *__init mxs_add_saif( struct platform_device *__init mxs_add_saif(
const struct mxs_saif_data *data); const struct mxs_saif_data *data,
const struct mxs_saif_platform_data *pdata);

Просмотреть файл

@ -0,0 +1,21 @@
/*
* Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
*
* 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.
*/
#ifndef __MACH_DIGCTL_H__
#define __MACH_DIGCTL_H__
/* MXS DIGCTL SAIF CLKMUX */
#define MXS_DIGCTL_SAIF_CLKMUX_DIRECT 0x0
#define MXS_DIGCTL_SAIF_CLKMUX_CROSSINPUT 0x1
#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0 0x2
#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR1 0x3
#define HW_DIGCTL_CTRL 0x0
#define BP_DIGCTL_CTRL_SAIF_CLKMUX 10
#define BM_DIGCTL_CTRL_SAIF_CLKMUX (0x3 << 10)
#endif

Просмотреть файл

@ -27,6 +27,7 @@
#include <mach/common.h> #include <mach/common.h>
#include <mach/iomux-mx28.h> #include <mach/iomux-mx28.h>
#include <mach/digctl.h>
#include "devices-mx28.h" #include "devices-mx28.h"
@ -421,6 +422,18 @@ static struct gpio mx28evk_lcd_gpios[] = {
{ MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" }, { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" },
}; };
static const struct mxs_saif_platform_data
mx28evk_mxs_saif_pdata[] __initconst = {
/* working on EXTMSTR0 mode (saif0 master, saif1 slave) */
{
.master_mode = 1,
.master_id = 0,
}, {
.master_mode = 0,
.master_id = 0,
},
};
static void __init mx28evk_init(void) static void __init mx28evk_init(void)
{ {
int ret; int ret;
@ -454,8 +467,9 @@ static void __init mx28evk_init(void)
else else
mx28_add_mxsfb(&mx28evk_mxsfb_pdata); mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
mx28_add_saif(0); mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
mx28_add_saif(1); mx28_add_saif(0, &mx28evk_mxs_saif_pdata[0]);
mx28_add_saif(1, &mx28evk_mxs_saif_pdata[1]);
mx28_add_mxs_i2c(0); mx28_add_mxs_i2c(0);
i2c_register_board_info(0, mxs_i2c0_board_info, i2c_register_board_info(0, mxs_i2c0_board_info,

Просмотреть файл

@ -410,6 +410,7 @@ static struct omap2_hsmmc_info mmc[] = {
{ {
.mmc = 5, .mmc = 5,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
.pm_caps = MMC_PM_KEEP_POWER,
.gpio_cd = -EINVAL, .gpio_cd = -EINVAL,
.gpio_wp = -EINVAL, .gpio_wp = -EINVAL,
.ocr_mask = MMC_VDD_165_195, .ocr_mask = MMC_VDD_165_195,

Просмотреть файл

@ -24,6 +24,7 @@
#include <linux/i2c/pca953x.h> #include <linux/i2c/pca953x.h>
#include <linux/can/platform/ti_hecc.h> #include <linux/can/platform/ti_hecc.h>
#include <linux/davinci_emac.h> #include <linux/davinci_emac.h>
#include <linux/mmc/host.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/am35xx.h> #include <mach/am35xx.h>
@ -40,6 +41,7 @@
#include "mux.h" #include "mux.h"
#include "control.h" #include "control.h"
#include "hsmmc.h"
#define AM35XX_EVM_MDIO_FREQUENCY (1000000) #define AM35XX_EVM_MDIO_FREQUENCY (1000000)
@ -455,6 +457,23 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
static struct omap_board_config_kernel am3517_evm_config[] __initdata = { static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
}; };
static struct omap2_hsmmc_info mmc[] = {
{
.mmc = 1,
.caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = 127,
.gpio_wp = 126,
},
{
.mmc = 2,
.caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = 128,
.gpio_wp = 129,
},
{} /* Terminator */
};
static void __init am3517_evm_init(void) static void __init am3517_evm_init(void)
{ {
omap_board_config = am3517_evm_config; omap_board_config = am3517_evm_config;
@ -483,6 +502,9 @@ static void __init am3517_evm_init(void)
/* MUSB */ /* MUSB */
am3517_evm_musb_init(); am3517_evm_musb_init();
/* MMC init function */
omap2_hsmmc_init(mmc);
} }
MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")

Просмотреть файл

@ -3297,7 +3297,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs-omap.0", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("usbhs_omap", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
@ -3333,7 +3333,7 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX), CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX),
CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("usbhs_omap", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
@ -3379,20 +3379,18 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX), CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX), CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs-omap.0", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), CLK("usbhs_omap", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
CLK("usbhs-omap.0", "utmi_p1_gfclk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "utmi_p1_gfclk", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "utmi_p2_gfclk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "utmi_p2_gfclk", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "xclk60mhsp1_ck", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "xclk60mhsp1_ck", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "xclk60mhsp2_ck", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "xclk60mhsp2_ck", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
CLK("usbhs-omap.0", "init_60m_fclk", &dummy_ck, CK_3XXX), CLK("usbhs_omap", "init_60m_fclk", &dummy_ck, CK_3XXX),
CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),

Просмотреть файл

@ -3304,7 +3304,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "uart2_fck", &uart2_fck, CK_443X), CLK(NULL, "uart2_fck", &uart2_fck, CK_443X),
CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
CLK("usbhs-omap.0", "fs_fck", &usb_host_fs_fck, CK_443X), CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
@ -3315,7 +3315,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X), CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
CLK("usbhs-omap.0", "hs_fck", &usb_host_hs_fck, CK_443X), CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X),
CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X), CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X), CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X), CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
@ -3323,7 +3323,7 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X), CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X), CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X), CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
CLK("usbhs-omap.0", "usbtll_ick", &usb_tll_hs_ick, CK_443X), CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
CLK(NULL, "usim_ck", &usim_ck, CK_443X), CLK(NULL, "usim_ck", &usim_ck, CK_443X),
CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
CLK(NULL, "usim_fck", &usim_fck, CK_443X), CLK(NULL, "usim_fck", &usim_fck, CK_443X),
@ -3383,8 +3383,8 @@ static struct omap_clk omap44xx_clks[] = {
CLK(NULL, "uart2_ick", &dummy_ck, CK_443X), CLK(NULL, "uart2_ick", &dummy_ck, CK_443X),
CLK(NULL, "uart3_ick", &dummy_ck, CK_443X), CLK(NULL, "uart3_ick", &dummy_ck, CK_443X),
CLK(NULL, "uart4_ick", &dummy_ck, CK_443X), CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
CLK("usbhs-omap.0", "usbhost_ick", &dummy_ck, CK_443X), CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X),
CLK("usbhs-omap.0", "usbtll_fck", &dummy_ck, CK_443X), CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X),
CLK("omap_wdt", "ick", &dummy_ck, CK_443X), CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
CLK("omap_timer.1", "32k_ck", &sys_32k_ck, CK_443X), CLK("omap_timer.1", "32k_ck", &sys_32k_ck, CK_443X),
CLK("omap_timer.2", "32k_ck", &sys_32k_ck, CK_443X), CLK("omap_timer.2", "32k_ck", &sys_32k_ck, CK_443X),

Просмотреть файл

@ -171,6 +171,17 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
} }
} }
static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc)
{
u32 reg;
if (mmc->slots[0].internal_clock) {
reg = omap_ctrl_readl(control_devconf1_offset);
reg |= OMAP2_MMCSDIO2ADPCLKISEL;
omap_ctrl_writel(reg, control_devconf1_offset);
}
}
static void hsmmc23_before_set_reg(struct device *dev, int slot, static void hsmmc23_before_set_reg(struct device *dev, int slot,
int power_on, int vdd) int power_on, int vdd)
{ {
@ -179,16 +190,19 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
if (mmc->slots[0].remux) if (mmc->slots[0].remux)
mmc->slots[0].remux(dev, slot, power_on); mmc->slots[0].remux(dev, slot, power_on);
if (power_on) { if (power_on)
/* Only MMC2 supports a CLKIN */ hsmmc2_select_input_clk_src(mmc);
if (mmc->slots[0].internal_clock) { }
u32 reg;
reg = omap_ctrl_readl(control_devconf1_offset); static int am35x_hsmmc2_set_power(struct device *dev, int slot,
reg |= OMAP2_MMCSDIO2ADPCLKISEL; int power_on, int vdd)
omap_ctrl_writel(reg, control_devconf1_offset); {
} struct omap_mmc_platform_data *mmc = dev->platform_data;
}
if (power_on)
hsmmc2_select_input_clk_src(mmc);
return 0;
} }
static int nop_mmc_set_power(struct device *dev, int slot, int power_on, static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
@ -200,10 +214,12 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller, static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
int controller_nr) int controller_nr)
{ {
if (gpio_is_valid(mmc_controller->slots[0].switch_pin)) if (gpio_is_valid(mmc_controller->slots[0].switch_pin) &&
(mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
if (gpio_is_valid(mmc_controller->slots[0].gpio_wp)) if (gpio_is_valid(mmc_controller->slots[0].gpio_wp) &&
(mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
@ -296,6 +312,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].name = hc_name; mmc->slots[0].name = hc_name;
mmc->nr_slots = 1; mmc->nr_slots = 1;
mmc->slots[0].caps = c->caps; mmc->slots[0].caps = c->caps;
mmc->slots[0].pm_caps = c->pm_caps;
mmc->slots[0].internal_clock = !c->ext_clock; mmc->slots[0].internal_clock = !c->ext_clock;
mmc->dma_mask = 0xffffffff; mmc->dma_mask = 0xffffffff;
if (cpu_is_omap44xx()) if (cpu_is_omap44xx())
@ -336,11 +353,17 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
* *
* temporary HACK: ocr_mask instead of fixed supply * temporary HACK: ocr_mask instead of fixed supply
*/ */
if (cpu_is_omap3505() || cpu_is_omap3517())
mmc->slots[0].ocr_mask = MMC_VDD_165_195 |
MMC_VDD_26_27 |
MMC_VDD_27_28 |
MMC_VDD_29_30 |
MMC_VDD_30_31 |
MMC_VDD_31_32;
else
mmc->slots[0].ocr_mask = c->ocr_mask; mmc->slots[0].ocr_mask = c->ocr_mask;
if (cpu_is_omap3517() || cpu_is_omap3505()) if (!cpu_is_omap3517() && !cpu_is_omap3505())
mmc->slots[0].set_power = nop_mmc_set_power;
else
mmc->slots[0].features |= HSMMC_HAS_PBIAS; mmc->slots[0].features |= HSMMC_HAS_PBIAS;
if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0))
@ -363,6 +386,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
} }
} }
if (cpu_is_omap3517() || cpu_is_omap3505())
mmc->slots[0].set_power = nop_mmc_set_power;
/* OMAP3630 HSMMC1 supports only 4-bit */ /* OMAP3630 HSMMC1 supports only 4-bit */
if (cpu_is_omap3630() && if (cpu_is_omap3630() &&
(c->caps & MMC_CAP_8_BIT_DATA)) { (c->caps & MMC_CAP_8_BIT_DATA)) {
@ -372,6 +398,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
} }
break; break;
case 2: case 2:
if (cpu_is_omap3517() || cpu_is_omap3505())
mmc->slots[0].set_power = am35x_hsmmc2_set_power;
if (c->ext_clock) if (c->ext_clock)
c->transceiver = 1; c->transceiver = 1;
if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {

Просмотреть файл

@ -12,6 +12,7 @@ struct omap2_hsmmc_info {
u8 mmc; /* controller 1/2/3 */ u8 mmc; /* controller 1/2/3 */
u32 caps; /* 4/8 wires and any additional host u32 caps; /* 4/8 wires and any additional host
* capabilities OR'd (ref. linux/mmc/host.h) */ * capabilities OR'd (ref. linux/mmc/host.h) */
u32 pm_caps; /* PM capabilities */
bool transceiver; /* MMC-2 option */ bool transceiver; /* MMC-2 option */
bool ext_clock; /* use external pin for input clock */ bool ext_clock; /* use external pin for input clock */
bool cover_only; /* No card detect - just cover switch */ bool cover_only; /* No card detect - just cover switch */

Просмотреть файл

@ -28,51 +28,28 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <plat/usb.h> #include <plat/usb.h>
#include <plat/omap_device.h>
#include "mux.h" #include "mux.h"
#ifdef CONFIG_MFD_OMAP_USB_HOST #ifdef CONFIG_MFD_OMAP_USB_HOST
#define OMAP_USBHS_DEVICE "usbhs-omap" #define OMAP_USBHS_DEVICE "usbhs_omap"
#define USBHS_UHH_HWMODNAME "usb_host_hs"
static struct resource usbhs_resources[] = { #define USBHS_TLL_HWMODNAME "usb_tll_hs"
{
.name = "uhh",
.flags = IORESOURCE_MEM,
},
{
.name = "tll",
.flags = IORESOURCE_MEM,
},
{
.name = "ehci",
.flags = IORESOURCE_MEM,
},
{
.name = "ehci-irq",
.flags = IORESOURCE_IRQ,
},
{
.name = "ohci",
.flags = IORESOURCE_MEM,
},
{
.name = "ohci-irq",
.flags = IORESOURCE_IRQ,
}
};
static struct platform_device usbhs_device = {
.name = OMAP_USBHS_DEVICE,
.id = 0,
.num_resources = ARRAY_SIZE(usbhs_resources),
.resource = usbhs_resources,
};
static struct usbhs_omap_platform_data usbhs_data; static struct usbhs_omap_platform_data usbhs_data;
static struct ehci_hcd_omap_platform_data ehci_data; static struct ehci_hcd_omap_platform_data ehci_data;
static struct ohci_hcd_omap_platform_data ohci_data; static struct ohci_hcd_omap_platform_data ohci_data;
static struct omap_device_pm_latency omap_uhhtll_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
/* MUX settings for EHCI pins */ /* MUX settings for EHCI pins */
/* /*
* setup_ehci_io_mux - initialize IO pad mux for USBHOST * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@ -508,6 +485,9 @@ static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
void __init usbhs_init(const struct usbhs_omap_board_data *pdata) void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
{ {
struct omap_hwmod *oh[2];
struct omap_device *od;
int bus_id = -1;
int i; int i;
for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
@ -523,46 +503,36 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
usbhs_data.ohci_data = &ohci_data; usbhs_data.ohci_data = &ohci_data;
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE;
usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
usbhs_resources[1].start = OMAP34XX_USBTLL_BASE;
usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
usbhs_resources[2].start = OMAP34XX_EHCI_BASE;
usbhs_resources[2].end = OMAP34XX_EHCI_BASE + SZ_1K - 1;
usbhs_resources[3].start = INT_34XX_EHCI_IRQ;
usbhs_resources[4].start = OMAP34XX_OHCI_BASE;
usbhs_resources[4].end = OMAP34XX_OHCI_BASE + SZ_1K - 1;
usbhs_resources[5].start = INT_34XX_OHCI_IRQ;
setup_ehci_io_mux(pdata->port_mode); setup_ehci_io_mux(pdata->port_mode);
setup_ohci_io_mux(pdata->port_mode); setup_ohci_io_mux(pdata->port_mode);
} else if (cpu_is_omap44xx()) { } else if (cpu_is_omap44xx()) {
usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE;
usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
usbhs_resources[1].start = OMAP44XX_USBTLL_BASE;
usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE;
usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
usbhs_resources[3].start = OMAP44XX_IRQ_EHCI;
usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE;
usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
usbhs_resources[5].start = OMAP44XX_IRQ_OHCI;
setup_4430ehci_io_mux(pdata->port_mode); setup_4430ehci_io_mux(pdata->port_mode);
setup_4430ohci_io_mux(pdata->port_mode); setup_4430ohci_io_mux(pdata->port_mode);
} }
if (platform_device_add_data(&usbhs_device, oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
&usbhs_data, sizeof(usbhs_data)) < 0) { if (!oh[0]) {
printk(KERN_ERR "USBHS platform_device_add_data failed\n"); pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME);
goto init_end; return;
} }
if (platform_device_register(&usbhs_device) < 0) oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
printk(KERN_ERR "USBHS platform_device_register failed\n"); if (!oh[1]) {
pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME);
init_end:
return; return;
} }
od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2,
(void *)&usbhs_data, sizeof(usbhs_data),
omap_uhhtll_latency,
ARRAY_SIZE(omap_uhhtll_latency), false);
if (IS_ERR(od)) {
pr_err("Could not build hwmod devices %s,%s\n",
USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME);
return;
}
}
#else #else
void __init usbhs_init(const struct usbhs_omap_board_data *pdata) void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
@ -570,5 +540,3 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
} }
#endif #endif

Просмотреть файл

@ -138,7 +138,7 @@ static void am200_cleanup(struct metronomefb_par *par)
{ {
int i; int i;
free_irq(IRQ_GPIO(RDY_GPIO_PIN), par); free_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), par);
for (i = 0; i < ARRAY_SIZE(gpios); i++) for (i = 0; i < ARRAY_SIZE(gpios); i++)
gpio_free(gpios[i]); gpio_free(gpios[i]);
@ -292,7 +292,7 @@ static int am200_setup_irq(struct fb_info *info)
{ {
int ret; int ret;
ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am200_handle_irq, ret = request_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), am200_handle_irq,
IRQF_DISABLED|IRQF_TRIGGER_FALLING, IRQF_DISABLED|IRQF_TRIGGER_FALLING,
"AM200", info->par); "AM200", info->par);
if (ret) if (ret)

Просмотреть файл

@ -176,7 +176,7 @@ static void am300_cleanup(struct broadsheetfb_par *par)
{ {
int i; int i;
free_irq(IRQ_GPIO(RDY_GPIO_PIN), par); free_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), par);
for (i = 0; i < ARRAY_SIZE(gpios); i++) for (i = 0; i < ARRAY_SIZE(gpios); i++)
gpio_free(gpios[i]); gpio_free(gpios[i]);
@ -240,7 +240,7 @@ static int am300_setup_irq(struct fb_info *info)
int ret; int ret;
struct broadsheetfb_par *par = info->par; struct broadsheetfb_par *par = info->par;
ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am300_handle_irq, ret = request_irq(PXA_GPIO_TO_IRQ(RDY_GPIO_PIN), am300_handle_irq,
IRQF_DISABLED|IRQF_TRIGGER_RISING, IRQF_DISABLED|IRQF_TRIGGER_RISING,
"AM300", par); "AM300", par);
if (ret) if (ret)

Просмотреть файл

@ -180,7 +180,7 @@ static unsigned long balloon3_ac97_pin_config[] __initdata = {
}; };
static struct ucb1400_pdata vpac270_ucb1400_pdata = { static struct ucb1400_pdata vpac270_ucb1400_pdata = {
.irq = IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ), .irq = PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ),
}; };

Просмотреть файл

@ -50,8 +50,8 @@ static struct resource capc7117_ide_resources[] = {
.flags = IORESOURCE_MEM .flags = IORESOURCE_MEM
}, },
[2] = { [2] = {
.start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)), .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
.end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO76)),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
} }
}; };
@ -80,7 +80,7 @@ static void __init capc7117_ide_init(void)
static struct plat_serial8250_port ti16c752_platform_data[] = { static struct plat_serial8250_port ti16c752_platform_data[] = {
[0] = { [0] = {
.mapbase = 0x14000000, .mapbase = 0x14000000,
.irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO78)), .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO78)),
.irqflags = IRQF_TRIGGER_RISING, .irqflags = IRQF_TRIGGER_RISING,
.flags = TI16C752_FLAGS, .flags = TI16C752_FLAGS,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
@ -89,7 +89,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
}, },
[1] = { [1] = {
.mapbase = 0x14000040, .mapbase = 0x14000040,
.irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO79)), .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO79)),
.irqflags = IRQF_TRIGGER_RISING, .irqflags = IRQF_TRIGGER_RISING,
.flags = TI16C752_FLAGS, .flags = TI16C752_FLAGS,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
@ -98,7 +98,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
}, },
[2] = { [2] = {
.mapbase = 0x14000080, .mapbase = 0x14000080,
.irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO80)), .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO80)),
.irqflags = IRQF_TRIGGER_RISING, .irqflags = IRQF_TRIGGER_RISING,
.flags = TI16C752_FLAGS, .flags = TI16C752_FLAGS,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
@ -107,7 +107,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
}, },
[3] = { [3] = {
.mapbase = 0x140000c0, .mapbase = 0x140000c0,
.irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO81)), .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO81)),
.irqflags = IRQF_TRIGGER_RISING, .irqflags = IRQF_TRIGGER_RISING,
.flags = TI16C752_FLAGS, .flags = TI16C752_FLAGS,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,

Просмотреть файл

@ -33,7 +33,7 @@
/* GPIO IRQ usage */ /* GPIO IRQ usage */
#define GPIO83_MMC_IRQ (83) #define GPIO83_MMC_IRQ (83)
#define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ) #define CMX270_MMC_IRQ PXA_GPIO_TO_IRQ(GPIO83_MMC_IRQ)
/* MMC power enable */ /* MMC power enable */
#define GPIO105_MMC_POWER (105) #define GPIO105_MMC_POWER (105)
@ -380,7 +380,7 @@ static struct spi_board_info cm_x270_spi_devices[] __initdata = {
.modalias = "libertas_spi", .modalias = "libertas_spi",
.max_speed_hz = 13000000, .max_speed_hz = 13000000,
.bus_num = 2, .bus_num = 2,
.irq = gpio_to_irq(95), .irq = PXA_GPIO_TO_IRQ(95),
.chip_select = 0, .chip_select = 0,
.controller_data = &cm_x270_libertas_chip, .controller_data = &cm_x270_libertas_chip,
.platform_data = &cm_x270_libertas_pdata, .platform_data = &cm_x270_libertas_pdata,

Просмотреть файл

@ -58,8 +58,8 @@ extern void cmx270_init(void);
#define CMX255_GPIO_IT8152_IRQ (0) #define CMX255_GPIO_IT8152_IRQ (0)
#define CMX270_GPIO_IT8152_IRQ (22) #define CMX270_GPIO_IT8152_IRQ (22)
#define CMX255_ETHIRQ IRQ_GPIO(GPIO22_ETHIRQ) #define CMX255_ETHIRQ PXA_GPIO_TO_IRQ(GPIO22_ETHIRQ)
#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ) #define CMX270_ETHIRQ PXA_GPIO_TO_IRQ(GPIO10_ETHIRQ)
#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
static struct resource cmx255_dm9000_resource[] = { static struct resource cmx255_dm9000_resource[] = {

Просмотреть файл

@ -64,7 +64,7 @@
#define GPIO82_MMC_IRQ (82) #define GPIO82_MMC_IRQ (82)
#define GPIO85_MMC_WP (85) #define GPIO85_MMC_WP (85)
#define CM_X300_MMC_IRQ IRQ_GPIO(GPIO82_MMC_IRQ) #define CM_X300_MMC_IRQ PXA_GPIO_TO_IRQ(GPIO82_MMC_IRQ)
#define GPIO95_RTC_CS (95) #define GPIO95_RTC_CS (95)
#define GPIO96_RTC_WR (96) #define GPIO96_RTC_WR (96)
@ -229,8 +229,8 @@ static struct resource dm9000_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[2] = { [2] = {
.start = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)), .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO99)),
.end = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO99)),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
} }
}; };

Просмотреть файл

@ -218,8 +218,8 @@ static struct resource colibri_pxa270_dm9000_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
{ {
.start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ), .start = PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ),
.end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
}, },
}; };
@ -249,7 +249,7 @@ static pxa2xx_audio_ops_t colibri_pxa270_ac97_pdata = {
}; };
static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = { static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = {
.irq = gpio_to_irq(GPIO113_COLIBRI_PXA270_TS_IRQ), .irq = PXA_GPIO_TO_IRQ(GPIO113_COLIBRI_PXA270_TS_IRQ),
}; };
static struct platform_device colibri_pxa270_ucb1400_device = { static struct platform_device colibri_pxa270_ucb1400_device = {

Просмотреть файл

@ -78,8 +78,8 @@ static struct resource colibri_asix_resource[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), .start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), .end = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
} }
}; };

Просмотреть файл

@ -115,8 +115,8 @@ static struct resource colibri_asix_resource[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), .start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
.end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), .end = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
} }
}; };

Просмотреть файл

@ -531,7 +531,7 @@ static struct spi_board_info corgi_spi_devices[] = {
.chip_select = 0, .chip_select = 0,
.platform_data = &corgi_ads7846_info, .platform_data = &corgi_ads7846_info,
.controller_data= &corgi_ads7846_chip, .controller_data= &corgi_ads7846_chip,
.irq = gpio_to_irq(CORGI_GPIO_TP_INT), .irq = PXA_GPIO_TO_IRQ(CORGI_GPIO_TP_INT),
}, { }, {
.modalias = "corgi-lcd", .modalias = "corgi-lcd",
.max_speed_hz = 50000, .max_speed_hz = 50000,

Просмотреть файл

@ -15,6 +15,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/gpio-pxa.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/apm-emulation.h> #include <linux/apm-emulation.h>
@ -40,7 +41,9 @@ static struct gpio charger_gpios[] = {
{ CORGI_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" }, { CORGI_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" },
{ CORGI_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" }, { CORGI_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" },
{ CORGI_GPIO_CHRG_UKN, GPIOF_OUT_INIT_LOW, "Charger Unknown" }, { CORGI_GPIO_CHRG_UKN, GPIOF_OUT_INIT_LOW, "Charger Unknown" },
{ CORGI_GPIO_AC_IN, GPIOF_IN, "Charger Detection" },
{ CORGI_GPIO_KEY_INT, GPIOF_IN, "Key Interrupt" }, { CORGI_GPIO_KEY_INT, GPIOF_IN, "Key Interrupt" },
{ CORGI_GPIO_WAKEUP, GPIOF_IN, "System wakeup notification" },
}; };
static void corgi_charger_init(void) static void corgi_charger_init(void)
@ -90,7 +93,12 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
{ {
int is_resume = 0; int is_resume = 0;
dev_dbg(sharpsl_pm.dev, "GPLR0 = %x,%x\n", GPLR0, PEDR); dev_dbg(sharpsl_pm.dev, "PEDR = %x, GPIO_AC_IN = %d, "
"GPIO_CHRG_FULL = %d, GPIO_KEY_INT = %d, GPIO_WAKEUP = %d\n",
PEDR, gpio_get_value(CORGI_GPIO_AC_IN),
gpio_get_value(CORGI_GPIO_CHRG_FULL),
gpio_get_value(CORGI_GPIO_KEY_INT),
gpio_get_value(CORGI_GPIO_WAKEUP));
if ((PEDR & GPIO_bit(CORGI_GPIO_AC_IN))) { if ((PEDR & GPIO_bit(CORGI_GPIO_AC_IN))) {
if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) { if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
@ -124,14 +132,21 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
static unsigned long corgi_charger_wakeup(void) static unsigned long corgi_charger_wakeup(void)
{ {
return ~GPLR0 & ( GPIO_bit(CORGI_GPIO_AC_IN) | GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) ); unsigned long ret;
ret = (!gpio_get_value(CORGI_GPIO_AC_IN) << GPIO_bit(CORGI_GPIO_AC_IN))
| (!gpio_get_value(CORGI_GPIO_KEY_INT)
<< GPIO_bit(CORGI_GPIO_KEY_INT))
| (!gpio_get_value(CORGI_GPIO_WAKEUP)
<< GPIO_bit(CORGI_GPIO_WAKEUP));
return ret;
} }
unsigned long corgipm_read_devdata(int type) unsigned long corgipm_read_devdata(int type)
{ {
switch(type) { switch(type) {
case SHARPSL_STATUS_ACIN: case SHARPSL_STATUS_ACIN:
return ((GPLR(CORGI_GPIO_AC_IN) & GPIO_bit(CORGI_GPIO_AC_IN)) != 0); return !gpio_get_value(CORGI_GPIO_AC_IN);
case SHARPSL_STATUS_LOCK: case SHARPSL_STATUS_LOCK:
return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock); return gpio_get_value(sharpsl_pm.machinfo->gpio_batlock);
case SHARPSL_STATUS_CHRGFULL: case SHARPSL_STATUS_CHRGFULL:

Просмотреть файл

@ -415,9 +415,29 @@ static struct resource pxa_rtc_resources[] = {
}, },
}; };
static struct resource sa1100_rtc_resources[] = {
[0] = {
.start = 0x40900000,
.end = 0x409000ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_RTC1Hz,
.end = IRQ_RTC1Hz,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_RTCAlrm,
.end = IRQ_RTCAlrm,
.flags = IORESOURCE_IRQ,
},
};
struct platform_device sa1100_device_rtc = { struct platform_device sa1100_device_rtc = {
.name = "sa1100-rtc", .name = "sa1100-rtc",
.id = -1, .id = -1,
.num_resources = ARRAY_SIZE(sa1100_rtc_resources),
.resource = sa1100_rtc_resources,
}; };
struct platform_device pxa_device_rtc = { struct platform_device pxa_device_rtc = {
@ -1051,6 +1071,36 @@ struct platform_device pxa3xx_device_ssp4 = {
}; };
#endif /* CONFIG_PXA3xx || CONFIG_PXA95x */ #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */
struct resource pxa_resource_gpio[] = {
{
.start = 0x40e00000,
.end = 0x40e0ffff,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_GPIO0,
.end = IRQ_GPIO0,
.name = "gpio0",
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_GPIO1,
.end = IRQ_GPIO1,
.name = "gpio1",
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_GPIO_2_x,
.end = IRQ_GPIO_2_x,
.name = "gpio_mux",
.flags = IORESOURCE_IRQ,
},
};
struct platform_device pxa_device_gpio = {
.name = "pxa-gpio",
.id = -1,
.num_resources = ARRAY_SIZE(pxa_resource_gpio),
.resource = pxa_resource_gpio,
};
/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
* See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)

Просмотреть файл

@ -16,6 +16,7 @@ extern struct platform_device pxa_device_ficp;
extern struct platform_device sa1100_device_rtc; extern struct platform_device sa1100_device_rtc;
extern struct platform_device pxa_device_rtc; extern struct platform_device pxa_device_rtc;
extern struct platform_device pxa_device_ac97; extern struct platform_device pxa_device_ac97;
extern struct platform_device pxa_device_gpio;
extern struct platform_device pxa27x_device_i2c_power; extern struct platform_device pxa27x_device_i2c_power;
extern struct platform_device pxa27x_device_ohci; extern struct platform_device pxa27x_device_ohci;

Просмотреть файл

@ -70,7 +70,7 @@
/* common GPIOs */ /* common GPIOs */
#define GPIO11_NAND_CS (11) #define GPIO11_NAND_CS (11)
#define GPIO41_ETHIRQ (41) #define GPIO41_ETHIRQ (41)
#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) #define EM_X270_ETHIRQ PXA_GPIO_TO_IRQ(GPIO41_ETHIRQ)
#define GPIO115_WLAN_PWEN (115) #define GPIO115_WLAN_PWEN (115)
#define GPIO19_WLAN_STRAP (19) #define GPIO19_WLAN_STRAP (19)
#define GPIO9_USB_VBUS_EN (9) #define GPIO9_USB_VBUS_EN (9)
@ -805,7 +805,7 @@ static struct spi_board_info em_x270_spi_devices[] __initdata = {
.modalias = "libertas_spi", .modalias = "libertas_spi",
.max_speed_hz = 13000000, .max_speed_hz = 13000000,
.bus_num = 2, .bus_num = 2,
.irq = IRQ_GPIO(116), .irq = PXA_GPIO_TO_IRQ(116),
.chip_select = 0, .chip_select = 0,
.controller_data = &em_x270_libertas_chip, .controller_data = &em_x270_libertas_chip,
.platform_data = &em_x270_libertas_pdata, .platform_data = &em_x270_libertas_pdata,
@ -1203,7 +1203,7 @@ static struct da903x_platform_data em_x270_da9030_info = {
static struct i2c_board_info em_x270_i2c_pmic_info = { static struct i2c_board_info em_x270_i2c_pmic_info = {
I2C_BOARD_INFO("da9030", 0x49), I2C_BOARD_INFO("da9030", 0x49),
.irq = IRQ_GPIO(0), .irq = PXA_GPIO_TO_IRQ(0),
.platform_data = &em_x270_da9030_info, .platform_data = &em_x270_da9030_info,
}; };

Просмотреть файл

@ -119,8 +119,8 @@ struct resource eseries_tmio_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ), .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
.end = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };

Просмотреть файл

@ -252,8 +252,8 @@ static struct resource asic3_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ), .start = PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ),
.end = gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO12_HX4700_ASIC3_IRQ),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
/* SD part */ /* SD part */
@ -263,8 +263,8 @@ static struct resource asic3_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[3] = { [3] = {
.start = gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ), .start = PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
.end = gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
@ -587,7 +587,7 @@ static struct spi_board_info tsc2046_board_info[] __initdata = {
.modalias = "ads7846", .modalias = "ads7846",
.bus_num = 2, .bus_num = 2,
.max_speed_hz = 2600000, /* 100 kHz sample rate */ .max_speed_hz = 2600000, /* 100 kHz sample rate */
.irq = gpio_to_irq(GPIO58_HX4700_TSC2046_nPENIRQ), .irq = PXA_GPIO_TO_IRQ(GPIO58_HX4700_TSC2046_nPENIRQ),
.platform_data = &tsc2046_info, .platform_data = &tsc2046_info,
.controller_data = &tsc2046_chip, .controller_data = &tsc2046_chip,
}, },
@ -635,15 +635,15 @@ static struct resource power_supply_resources[] = {
.name = "ac", .name = "ac",
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
IORESOURCE_IRQ_LOWEDGE, IORESOURCE_IRQ_LOWEDGE,
.start = gpio_to_irq(GPIOD9_nAC_IN), .start = PXA_GPIO_TO_IRQ(GPIOD9_nAC_IN),
.end = gpio_to_irq(GPIOD9_nAC_IN), .end = PXA_GPIO_TO_IRQ(GPIOD9_nAC_IN),
}, },
[1] = { [1] = {
.name = "usb", .name = "usb",
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
IORESOURCE_IRQ_LOWEDGE, IORESOURCE_IRQ_LOWEDGE,
.start = gpio_to_irq(GPIOD14_nUSBC_DETECT), .start = PXA_GPIO_TO_IRQ(GPIOD14_nUSBC_DETECT),
.end = gpio_to_irq(GPIOD14_nUSBC_DETECT), .end = PXA_GPIO_TO_IRQ(GPIOD14_nUSBC_DETECT),
}, },
}; };

Просмотреть файл

@ -86,7 +86,7 @@ static struct spi_board_info mcp251x_board_info[] = {
.chip_select = 0, .chip_select = 0,
.platform_data = &mcp251x_info, .platform_data = &mcp251x_info,
.controller_data = &mcp251x_chip_info1, .controller_data = &mcp251x_chip_info1,
.irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ1) .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ1)
}, },
{ {
.modalias = "mcp2515", .modalias = "mcp2515",
@ -95,7 +95,7 @@ static struct spi_board_info mcp251x_board_info[] = {
.chip_select = 1, .chip_select = 1,
.platform_data = &mcp251x_info, .platform_data = &mcp251x_info,
.controller_data = &mcp251x_chip_info2, .controller_data = &mcp251x_chip_info2,
.irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ2) .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ2)
}, },
{ {
.modalias = "mcp2515", .modalias = "mcp2515",
@ -104,7 +104,7 @@ static struct spi_board_info mcp251x_board_info[] = {
.chip_select = 0, .chip_select = 0,
.platform_data = &mcp251x_info, .platform_data = &mcp251x_info,
.controller_data = &mcp251x_chip_info3, .controller_data = &mcp251x_chip_info3,
.irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ3) .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ3)
}, },
{ {
.modalias = "mcp2515", .modalias = "mcp2515",
@ -113,7 +113,7 @@ static struct spi_board_info mcp251x_board_info[] = {
.chip_select = 1, .chip_select = 1,
.platform_data = &mcp251x_info, .platform_data = &mcp251x_info,
.controller_data = &mcp251x_chip_info4, .controller_data = &mcp251x_chip_info4,
.irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ4) .irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ4)
} }
}; };

Просмотреть файл

@ -75,8 +75,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = IRQ_GPIO(4), .start = PXA_GPIO_TO_IRQ(4),
.end = IRQ_GPIO(4), .end = PXA_GPIO_TO_IRQ(4),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
} }
}; };

Просмотреть файл

@ -172,9 +172,9 @@ enum balloon3_features {
/* Balloon3 Interrupts */ /* Balloon3 Interrupts */
#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x)) #define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ) #define BALLOON3_AUX_NIRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_AUX_NIRQ)
#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) #define BALLOON3_CODEC_IRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ)
#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) #define BALLOON3_S0_CD_IRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_S0_CD)
#define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16) #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16)

Просмотреть файл

@ -66,18 +66,18 @@
/* /*
* Corgi Interrupts * Corgi Interrupts
*/ */
#define CORGI_IRQ_GPIO_KEY_INT IRQ_GPIO(0) #define CORGI_IRQ_GPIO_KEY_INT PXA_GPIO_TO_IRQ(0)
#define CORGI_IRQ_GPIO_AC_IN IRQ_GPIO(1) #define CORGI_IRQ_GPIO_AC_IN PXA_GPIO_TO_IRQ(1)
#define CORGI_IRQ_GPIO_WAKEUP IRQ_GPIO(3) #define CORGI_IRQ_GPIO_WAKEUP PXA_GPIO_TO_IRQ(3)
#define CORGI_IRQ_GPIO_AK_INT IRQ_GPIO(4) #define CORGI_IRQ_GPIO_AK_INT PXA_GPIO_TO_IRQ(4)
#define CORGI_IRQ_GPIO_TP_INT IRQ_GPIO(5) #define CORGI_IRQ_GPIO_TP_INT PXA_GPIO_TO_IRQ(5)
#define CORGI_IRQ_GPIO_nSD_DETECT IRQ_GPIO(9) #define CORGI_IRQ_GPIO_nSD_DETECT PXA_GPIO_TO_IRQ(9)
#define CORGI_IRQ_GPIO_nSD_INT IRQ_GPIO(10) #define CORGI_IRQ_GPIO_nSD_INT PXA_GPIO_TO_IRQ(10)
#define CORGI_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(11) #define CORGI_IRQ_GPIO_MAIN_BAT_LOW PXA_GPIO_TO_IRQ(11)
#define CORGI_IRQ_GPIO_CF_CD IRQ_GPIO(14) #define CORGI_IRQ_GPIO_CF_CD PXA_GPIO_TO_IRQ(14)
#define CORGI_IRQ_GPIO_CHRG_FULL IRQ_GPIO(16) /* Battery fully charged */ #define CORGI_IRQ_GPIO_CHRG_FULL PXA_GPIO_TO_IRQ(16) /* Battery fully charged */
#define CORGI_IRQ_GPIO_CF_IRQ IRQ_GPIO(17) #define CORGI_IRQ_GPIO_CF_IRQ PXA_GPIO_TO_IRQ(17)
#define CORGI_IRQ_GPIO_KEY_SENSE(a) IRQ_GPIO(58+(a)) /* Keyboard Sense lines */ #define CORGI_IRQ_GPIO_KEY_SENSE(a) PXA_GPIO_TO_IRQ(58+(a)) /* Keyboard Sense lines */
/* /*
@ -98,7 +98,7 @@
CORGI_SCP_MIC_BIAS ) CORGI_SCP_MIC_BIAS )
#define CORGI_SCOOP_IO_OUT ( CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R ) #define CORGI_SCOOP_IO_OUT ( CORGI_SCP_MUTE_L | CORGI_SCP_MUTE_R )
#define CORGI_SCOOP_GPIO_BASE (NR_BUILTIN_GPIO) #define CORGI_SCOOP_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
#define CORGI_GPIO_LED_GREEN (CORGI_SCOOP_GPIO_BASE + 0) #define CORGI_GPIO_LED_GREEN (CORGI_SCOOP_GPIO_BASE + 0)
#define CORGI_GPIO_SWA (CORGI_SCOOP_GPIO_BASE + 1) /* Hinge Switch A */ #define CORGI_GPIO_SWA (CORGI_SCOOP_GPIO_BASE + 1) /* Hinge Switch A */
#define CORGI_GPIO_SWB (CORGI_SCOOP_GPIO_BASE + 2) /* Hinge Switch B */ #define CORGI_GPIO_SWB (CORGI_SCOOP_GPIO_BASE + 2) /* Hinge Switch B */

Просмотреть файл

@ -19,8 +19,8 @@
#define CSB726_FLASH_SIZE (64 * 1024 * 1024) #define CSB726_FLASH_SIZE (64 * 1024 * 1024)
#define CSB726_FLASH_uMON (8 * 1024 * 1024) #define CSB726_FLASH_uMON (8 * 1024 * 1024)
#define CSB726_IRQ_LAN gpio_to_irq(CSB726_GPIO_IRQ_LAN) #define CSB726_IRQ_LAN PXA_GPIO_TO_IRQ(CSB726_GPIO_IRQ_LAN)
#define CSB726_IRQ_SM501 gpio_to_irq(CSB726_GPIO_IRQ_SM501) #define CSB726_IRQ_SM501 PXA_GPIO_TO_IRQ(CSB726_GPIO_IRQ_SM501)
#endif #endif

Просмотреть файл

@ -1,133 +0,0 @@
/*
* Written by Philipp Zabel <philipp.zabel@gmail.com>
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __MACH_PXA_GPIO_PXA_H
#define __MACH_PXA_GPIO_PXA_H
#include <mach/irqs.h>
#include <mach/hardware.h>
#define GPIO_REGS_VIRT io_p2v(0x40E00000)
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
#define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
/* GPIO Pin Level Registers */
#define GPLR0 GPIO_REG(BANK_OFF(0) + 0x00)
#define GPLR1 GPIO_REG(BANK_OFF(1) + 0x00)
#define GPLR2 GPIO_REG(BANK_OFF(2) + 0x00)
#define GPLR3 GPIO_REG(BANK_OFF(3) + 0x00)
/* GPIO Pin Direction Registers */
#define GPDR0 GPIO_REG(BANK_OFF(0) + 0x0c)
#define GPDR1 GPIO_REG(BANK_OFF(1) + 0x0c)
#define GPDR2 GPIO_REG(BANK_OFF(2) + 0x0c)
#define GPDR3 GPIO_REG(BANK_OFF(3) + 0x0c)
/* GPIO Pin Output Set Registers */
#define GPSR0 GPIO_REG(BANK_OFF(0) + 0x18)
#define GPSR1 GPIO_REG(BANK_OFF(1) + 0x18)
#define GPSR2 GPIO_REG(BANK_OFF(2) + 0x18)
#define GPSR3 GPIO_REG(BANK_OFF(3) + 0x18)
/* GPIO Pin Output Clear Registers */
#define GPCR0 GPIO_REG(BANK_OFF(0) + 0x24)
#define GPCR1 GPIO_REG(BANK_OFF(1) + 0x24)
#define GPCR2 GPIO_REG(BANK_OFF(2) + 0x24)
#define GPCR3 GPIO_REG(BANK_OFF(3) + 0x24)
/* GPIO Rising Edge Detect Registers */
#define GRER0 GPIO_REG(BANK_OFF(0) + 0x30)
#define GRER1 GPIO_REG(BANK_OFF(1) + 0x30)
#define GRER2 GPIO_REG(BANK_OFF(2) + 0x30)
#define GRER3 GPIO_REG(BANK_OFF(3) + 0x30)
/* GPIO Falling Edge Detect Registers */
#define GFER0 GPIO_REG(BANK_OFF(0) + 0x3c)
#define GFER1 GPIO_REG(BANK_OFF(1) + 0x3c)
#define GFER2 GPIO_REG(BANK_OFF(2) + 0x3c)
#define GFER3 GPIO_REG(BANK_OFF(3) + 0x3c)
/* GPIO Edge Detect Status Registers */
#define GEDR0 GPIO_REG(BANK_OFF(0) + 0x48)
#define GEDR1 GPIO_REG(BANK_OFF(1) + 0x48)
#define GEDR2 GPIO_REG(BANK_OFF(2) + 0x48)
#define GEDR3 GPIO_REG(BANK_OFF(3) + 0x48)
/* GPIO Alternate Function Select Registers */
#define GAFR0_L GPIO_REG(0x0054)
#define GAFR0_U GPIO_REG(0x0058)
#define GAFR1_L GPIO_REG(0x005C)
#define GAFR1_U GPIO_REG(0x0060)
#define GAFR2_L GPIO_REG(0x0064)
#define GAFR2_U GPIO_REG(0x0068)
#define GAFR3_L GPIO_REG(0x006C)
#define GAFR3_U GPIO_REG(0x0070)
/* More handy macros. The argument is a literal GPIO number. */
#define GPIO_bit(x) (1 << ((x) & 0x1f))
#define GPLR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x00)
#define GPDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x0c)
#define GPSR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x18)
#define GPCR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x24)
#define GRER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x30)
#define GFER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x3c)
#define GEDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x48)
#define GAFR(x) GPIO_REG(0x54 + (((x) & 0x70) >> 2))
#define NR_BUILTIN_GPIO PXA_GPIO_IRQ_NUM
#define gpio_to_bank(gpio) ((gpio) >> 5)
#ifdef CONFIG_CPU_PXA26x
/* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted,
* as well as their Alternate Function value being '1' for GPIO in GAFRx.
*/
static inline int __gpio_is_inverted(unsigned gpio)
{
return cpu_is_pxa25x() && gpio > 85;
}
#else
static inline int __gpio_is_inverted(unsigned gpio) { return 0; }
#endif
/*
* On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
* function of a GPIO, and GPDRx cannot be altered once configured. It
* is attributed as "occupied" here (I know this terminology isn't
* accurate, you are welcome to propose a better one :-)
*/
static inline int __gpio_is_occupied(unsigned gpio)
{
if (cpu_is_pxa27x() || cpu_is_pxa25x()) {
int af = (GAFR(gpio) >> ((gpio & 0xf) * 2)) & 0x3;
int dir = GPDR(gpio) & GPIO_bit(gpio);
if (__gpio_is_inverted(gpio))
return af != 1 || dir == 0;
else
return af != 0 || dir != 0;
} else
return GPDR(gpio) & GPIO_bit(gpio);
}
#include <plat/gpio-pxa.h>
#endif /* __MACH_PXA_GPIO_PXA_H */

Просмотреть файл

@ -25,24 +25,8 @@
#define __ASM_ARCH_PXA_GPIO_H #define __ASM_ARCH_PXA_GPIO_H
#include <asm-generic/gpio.h> #include <asm-generic/gpio.h>
/* The defines for the driver are needed for the accelerated accessors */
#include "gpio-pxa.h"
#define gpio_to_irq(gpio) IRQ_GPIO(gpio) #include <mach/irqs.h>
#include <mach/hardware.h>
static inline int irq_to_gpio(unsigned int irq)
{
int gpio;
if (irq == IRQ_GPIO0 || irq == IRQ_GPIO1)
return irq - IRQ_GPIO0;
gpio = irq - PXA_GPIO_IRQ_BASE;
if (gpio >= 2 && gpio < NR_BUILTIN_GPIO)
return gpio;
return -1;
}
#include <plat/gpio.h>
#endif #endif

Просмотреть файл

@ -24,7 +24,7 @@ has detected a cable insertion; driven low otherwise. */
#define GPIO_GUMSTIX_USB_GPIOx 41 #define GPIO_GUMSTIX_USB_GPIOx 41
/* usb state change */ /* usb state change */
#define GUMSTIX_USB_INTR_IRQ IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn) #define GUMSTIX_USB_INTR_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_USB_GPIOn)
#define GPIO_GUMSTIX_USB_GPIOn_MD (GPIO_GUMSTIX_USB_GPIOn | GPIO_IN) #define GPIO_GUMSTIX_USB_GPIOn_MD (GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
#define GPIO_GUMSTIX_USB_GPIOx_CON_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT) #define GPIO_GUMSTIX_USB_GPIOx_CON_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
@ -35,7 +35,7 @@ has detected a cable insertion; driven low otherwise. */
*/ */
#define GUMSTIX_GPIO_nSD_WP 22 /* SD Write Protect */ #define GUMSTIX_GPIO_nSD_WP 22 /* SD Write Protect */
#define GUMSTIX_GPIO_nSD_DETECT 11 /* MMC/SD Card Detect */ #define GUMSTIX_GPIO_nSD_DETECT 11 /* MMC/SD Card Detect */
#define GUMSTIX_IRQ_GPIO_nSD_DETECT IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT) #define GUMSTIX_IRQ_GPIO_nSD_DETECT PXA_GPIO_TO_IRQ(GUMSTIX_GPIO_nSD_DETECT)
/* /*
* SMC Ethernet definitions * SMC Ethernet definitions
@ -49,10 +49,10 @@ has detected a cable insertion; driven low otherwise. */
#define GPIO_GUMSTIX_ETH0 36 #define GPIO_GUMSTIX_ETH0 36
#define GPIO_GUMSTIX_ETH0_MD (GPIO_GUMSTIX_ETH0 | GPIO_IN) #define GPIO_GUMSTIX_ETH0_MD (GPIO_GUMSTIX_ETH0 | GPIO_IN)
#define GUMSTIX_ETH0_IRQ IRQ_GPIO(GPIO_GUMSTIX_ETH0) #define GUMSTIX_ETH0_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0)
#define GPIO_GUMSTIX_ETH1 27 #define GPIO_GUMSTIX_ETH1 27
#define GPIO_GUMSTIX_ETH1_MD (GPIO_GUMSTIX_ETH1 | GPIO_IN) #define GPIO_GUMSTIX_ETH1_MD (GPIO_GUMSTIX_ETH1 | GPIO_IN)
#define GUMSTIX_ETH1_IRQ IRQ_GPIO(GPIO_GUMSTIX_ETH1) #define GUMSTIX_ETH1_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH1)
/* CF reset line */ /* CF reset line */
@ -63,18 +63,18 @@ has detected a cable insertion; driven low otherwise. */
#define GPIO4_nSTSCHG GPIO4_nBVD1 #define GPIO4_nSTSCHG GPIO4_nBVD1
#define GPIO11_nCD 11 #define GPIO11_nCD 11
#define GPIO26_PRDY_nBSY 26 #define GPIO26_PRDY_nBSY 26
#define GUMSTIX_S0_nSTSCHG_IRQ IRQ_GPIO(GPIO4_nSTSCHG) #define GUMSTIX_S0_nSTSCHG_IRQ PXA_GPIO_TO_IRQ(GPIO4_nSTSCHG)
#define GUMSTIX_S0_nCD_IRQ IRQ_GPIO(GPIO11_nCD) #define GUMSTIX_S0_nCD_IRQ PXA_GPIO_TO_IRQ(GPIO11_nCD)
#define GUMSTIX_S0_PRDY_nBSY_IRQ IRQ_GPIO(GPIO26_PRDY_nBSY) #define GUMSTIX_S0_PRDY_nBSY_IRQ PXA_GPIO_TO_IRQ(GPIO26_PRDY_nBSY)
/* CF slot 1 */ /* CF slot 1 */
#define GPIO18_nBVD1 18 #define GPIO18_nBVD1 18
#define GPIO18_nSTSCHG GPIO18_nBVD1 #define GPIO18_nSTSCHG GPIO18_nBVD1
#define GPIO36_nCD 36 #define GPIO36_nCD 36
#define GPIO27_PRDY_nBSY 27 #define GPIO27_PRDY_nBSY 27
#define GUMSTIX_S1_nSTSCHG_IRQ IRQ_GPIO(GPIO18_nSTSCHG) #define GUMSTIX_S1_nSTSCHG_IRQ PXA_GPIO_TO_IRQ(GPIO18_nSTSCHG)
#define GUMSTIX_S1_nCD_IRQ IRQ_GPIO(GPIO36_nCD) #define GUMSTIX_S1_nCD_IRQ PXA_GPIO_TO_IRQ(GPIO36_nCD)
#define GUMSTIX_S1_PRDY_nBSY_IRQ IRQ_GPIO(GPIO27_PRDY_nBSY) #define GUMSTIX_S1_PRDY_nBSY_IRQ PXA_GPIO_TO_IRQ(GPIO27_PRDY_nBSY)
/* CF GPIO line modes */ /* CF GPIO line modes */
#define GPIO4_nSTSCHG_MD (GPIO4_nSTSCHG | GPIO_IN) #define GPIO4_nSTSCHG_MD (GPIO4_nSTSCHG | GPIO_IN)

Просмотреть файл

@ -15,7 +15,7 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/mfd/asic3.h> #include <linux/mfd/asic3.h>
#define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO
#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS) #define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
#define HX4700_NR_IRQS (IRQ_BOARD_START + 70) #define HX4700_NR_IRQS (IRQ_BOARD_START + 70)

Просмотреть файл

@ -131,28 +131,26 @@
#define PCC_VS2 (1 << 1) #define PCC_VS2 (1 << 1)
#define PCC_VS1 (1 << 0) #define PCC_VS1 (1 << 0)
#define PCC_DETECT(x) (GPLR(7 + (x)) & GPIO_bit(7 + (x)))
/* A listing of interrupts used by external hardware devices */ /* A listing of interrupts used by external hardware devices */
#define TOUCH_PANEL_IRQ IRQ_GPIO(5) #define TOUCH_PANEL_IRQ PXA_GPIO_TO_IRQ(5)
#define IDE_IRQ IRQ_GPIO(21) #define IDE_IRQ PXA_GPIO_TO_IRQ(21)
#define TOUCH_PANEL_IRQ_EDGE IRQ_TYPE_EDGE_FALLING #define TOUCH_PANEL_IRQ_EDGE IRQ_TYPE_EDGE_FALLING
#define ETHERNET_IRQ IRQ_GPIO(4) #define ETHERNET_IRQ PXA_GPIO_TO_IRQ(4)
#define ETHERNET_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define ETHERNET_IRQ_EDGE IRQ_TYPE_EDGE_RISING
#define IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING
#define PCMCIA_S0_CD_VALID IRQ_GPIO(7) #define PCMCIA_S0_CD_VALID PXA_GPIO_TO_IRQ(7)
#define PCMCIA_S0_CD_VALID_EDGE IRQ_TYPE_EDGE_BOTH #define PCMCIA_S0_CD_VALID_EDGE IRQ_TYPE_EDGE_BOTH
#define PCMCIA_S1_CD_VALID IRQ_GPIO(8) #define PCMCIA_S1_CD_VALID PXA_GPIO_TO_IRQ(8)
#define PCMCIA_S1_CD_VALID_EDGE IRQ_TYPE_EDGE_BOTH #define PCMCIA_S1_CD_VALID_EDGE IRQ_TYPE_EDGE_BOTH
#define PCMCIA_S0_RDYINT IRQ_GPIO(19) #define PCMCIA_S0_RDYINT PXA_GPIO_TO_IRQ(19)
#define PCMCIA_S1_RDYINT IRQ_GPIO(22) #define PCMCIA_S1_RDYINT PXA_GPIO_TO_IRQ(22)
/* /*

Просмотреть файл

@ -88,10 +88,8 @@
#define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */ #define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */
#define PXA_GPIO_IRQ_BASE PXA_IRQ(96) #define PXA_GPIO_IRQ_BASE PXA_IRQ(96)
#define PXA_GPIO_IRQ_NUM (192) #define PXA_NR_BUILTIN_GPIO (192)
#define PXA_GPIO_TO_IRQ(x) (PXA_GPIO_IRQ_BASE + (x))
#define GPIO_2_x_TO_IRQ(x) (PXA_GPIO_IRQ_BASE + (x))
#define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x))
/* /*
* The following interrupts are for board specific purposes. Since * The following interrupts are for board specific purposes. Since
@ -100,7 +98,7 @@
* By default, no board IRQ is reserved. It should be finished in * By default, no board IRQ is reserved. It should be finished in
* custom board since sparse IRQ is already enabled. * custom board since sparse IRQ is already enabled.
*/ */
#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM) #define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_NR_BUILTIN_GPIO)
#define NR_IRQS (IRQ_BOARD_START) #define NR_IRQS (IRQ_BOARD_START)

Просмотреть файл

@ -1,13 +1,11 @@
#ifndef __ASM_ARCH_LITTLETON_H #ifndef __ASM_ARCH_LITTLETON_H
#define __ASM_ARCH_LITTLETON_H #define __ASM_ARCH_LITTLETON_H
#include <mach/gpio-pxa.h>
#define LITTLETON_ETH_PHYS 0x30000000 #define LITTLETON_ETH_PHYS 0x30000000
#define LITTLETON_GPIO_LCD_CS (17) #define LITTLETON_GPIO_LCD_CS (17)
#define EXT0_GPIO_BASE (NR_BUILTIN_GPIO) #define EXT0_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
#define EXT0_GPIO(x) (EXT0_GPIO_BASE + (x)) #define EXT0_GPIO(x) (EXT0_GPIO_BASE + (x))
#define LITTLETON_NR_IRQS (IRQ_BOARD_START + 8) #define LITTLETON_NR_IRQS (IRQ_BOARD_START + 8)

Просмотреть файл

@ -78,7 +78,7 @@
* CPLD EGPIOs * CPLD EGPIOs
*/ */
#define MAGICIAN_EGPIO_BASE NR_BUILTIN_GPIO #define MAGICIAN_EGPIO_BASE PXA_NR_BUILTIN_GPIO
#define MAGICIAN_EGPIO(reg,bit) \ #define MAGICIAN_EGPIO(reg,bit) \
(MAGICIAN_EGPIO_BASE + 8*reg + bit) (MAGICIAN_EGPIO_BASE + 8*reg + bit)

Просмотреть файл

@ -68,10 +68,10 @@
/* 20, 53 and 86 are usb related too */ /* 20, 53 and 86 are usb related too */
/* INTERRUPTS */ /* INTERRUPTS */
#define IRQ_GPIO_PALMLD_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMLD_GPIO_RESET) #define IRQ_GPIO_PALMLD_GPIO_RESET PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_GPIO_RESET)
#define IRQ_GPIO_PALMLD_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMLD_SD_DETECT_N) #define IRQ_GPIO_PALMLD_SD_DETECT_N PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_SD_DETECT_N)
#define IRQ_GPIO_PALMLD_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMLD_WM9712_IRQ) #define IRQ_GPIO_PALMLD_WM9712_IRQ PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_WM9712_IRQ)
#define IRQ_GPIO_PALMLD_IDE_IRQ IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ) #define IRQ_GPIO_PALMLD_IDE_IRQ PXA_GPIO_TO_IRQ(GPIO_NR_PALMLD_IDE_IRQ)
/** HERE ARE INIT VALUES **/ /** HERE ARE INIT VALUES **/

Просмотреть файл

@ -48,10 +48,10 @@
#define GPIO_NR_PALMT5_BT_RESET 83 #define GPIO_NR_PALMT5_BT_RESET 83
/* INTERRUPTS */ /* INTERRUPTS */
#define IRQ_GPIO_PALMT5_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMT5_SD_DETECT_N) #define IRQ_GPIO_PALMT5_SD_DETECT_N PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_SD_DETECT_N)
#define IRQ_GPIO_PALMT5_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMT5_WM9712_IRQ) #define IRQ_GPIO_PALMT5_WM9712_IRQ PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_WM9712_IRQ)
#define IRQ_GPIO_PALMT5_USB_DETECT IRQ_GPIO(GPIO_NR_PALMT5_USB_DETECT) #define IRQ_GPIO_PALMT5_USB_DETECT PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_USB_DETECT)
#define IRQ_GPIO_PALMT5_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMT5_GPIO_RESET) #define IRQ_GPIO_PALMT5_GPIO_RESET PXA_GPIO_TO_IRQ(GPIO_NR_PALMT5_GPIO_RESET)
/** HERE ARE INIT VALUES **/ /** HERE ARE INIT VALUES **/

Просмотреть файл

@ -52,8 +52,8 @@
#define GPIO_NR_PALMTC_IR_DISABLE 45 #define GPIO_NR_PALMTC_IR_DISABLE 45
/* IRQs */ /* IRQs */
#define IRQ_GPIO_PALMTC_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMTC_SD_DETECT_N) #define IRQ_GPIO_PALMTC_SD_DETECT_N PXA_GPIO_TO_IRQ(GPIO_NR_PALMTC_SD_DETECT_N)
#define IRQ_GPIO_PALMTC_WLAN_READY IRQ_GPIO(GPIO_NR_PALMTC_WLAN_READY) #define IRQ_GPIO_PALMTC_WLAN_READY PXA_GPIO_TO_IRQ(GPIO_NR_PALMTC_WLAN_READY)
/* UCB1400 GPIOs */ /* UCB1400 GPIOs */
#define GPIO_NR_PALMTC_POWER_DETECT (0x80 | 0x00) #define GPIO_NR_PALMTC_POWER_DETECT (0x80 | 0x00)

Просмотреть файл

@ -62,10 +62,10 @@
#define GPIO_NR_PALMTX_NAND_BUFFER_DIR 79 #define GPIO_NR_PALMTX_NAND_BUFFER_DIR 79
/* INTERRUPTS */ /* INTERRUPTS */
#define IRQ_GPIO_PALMTX_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMTX_SD_DETECT_N) #define IRQ_GPIO_PALMTX_SD_DETECT_N PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_SD_DETECT_N)
#define IRQ_GPIO_PALMTX_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMTX_WM9712_IRQ) #define IRQ_GPIO_PALMTX_WM9712_IRQ PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_WM9712_IRQ)
#define IRQ_GPIO_PALMTX_USB_DETECT IRQ_GPIO(GPIO_NR_PALMTX_USB_DETECT) #define IRQ_GPIO_PALMTX_USB_DETECT PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_USB_DETECT)
#define IRQ_GPIO_PALMTX_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMTX_GPIO_RESET) #define IRQ_GPIO_PALMTX_GPIO_RESET PXA_GPIO_TO_IRQ(GPIO_NR_PALMTX_GPIO_RESET)
/** HERE ARE INIT VALUES **/ /** HERE ARE INIT VALUES **/

Просмотреть файл

@ -34,7 +34,7 @@
/* I2C RTC */ /* I2C RTC */
#define PCM027_RTC_IRQ_GPIO 0 #define PCM027_RTC_IRQ_GPIO 0
#define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) #define PCM027_RTC_IRQ PXA_GPIO_TO_IRQ(PCM027_RTC_IRQ_GPIO)
#define PCM027_RTC_IRQ_EDGE IRQ_TYPE_EDGE_FALLING #define PCM027_RTC_IRQ_EDGE IRQ_TYPE_EDGE_FALLING
#define ADR_PCM027_RTC 0x51 /* I2C address */ #define ADR_PCM027_RTC 0x51 /* I2C address */
@ -43,21 +43,21 @@
/* Ethernet chip (SMSC91C111) */ /* Ethernet chip (SMSC91C111) */
#define PCM027_ETH_IRQ_GPIO 52 #define PCM027_ETH_IRQ_GPIO 52
#define PCM027_ETH_IRQ IRQ_GPIO(PCM027_ETH_IRQ_GPIO) #define PCM027_ETH_IRQ PXA_GPIO_TO_IRQ(PCM027_ETH_IRQ_GPIO)
#define PCM027_ETH_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define PCM027_ETH_IRQ_EDGE IRQ_TYPE_EDGE_RISING
#define PCM027_ETH_PHYS PXA_CS5_PHYS #define PCM027_ETH_PHYS PXA_CS5_PHYS
#define PCM027_ETH_SIZE (1*1024*1024) #define PCM027_ETH_SIZE (1*1024*1024)
/* CAN controller SJA1000 (unsupported yet) */ /* CAN controller SJA1000 (unsupported yet) */
#define PCM027_CAN_IRQ_GPIO 114 #define PCM027_CAN_IRQ_GPIO 114
#define PCM027_CAN_IRQ IRQ_GPIO(PCM027_CAN_IRQ_GPIO) #define PCM027_CAN_IRQ PXA_GPIO_TO_IRQ(PCM027_CAN_IRQ_GPIO)
#define PCM027_CAN_IRQ_EDGE IRQ_TYPE_EDGE_FALLING #define PCM027_CAN_IRQ_EDGE IRQ_TYPE_EDGE_FALLING
#define PCM027_CAN_PHYS 0x22000000 #define PCM027_CAN_PHYS 0x22000000
#define PCM027_CAN_SIZE 0x100 #define PCM027_CAN_SIZE 0x100
/* SPI GPIO expander (unsupported yet) */ /* SPI GPIO expander (unsupported yet) */
#define PCM027_EGPIO_IRQ_GPIO 27 #define PCM027_EGPIO_IRQ_GPIO 27
#define PCM027_EGPIO_IRQ IRQ_GPIO(PCM027_EGPIO_IRQ_GPIO) #define PCM027_EGPIO_IRQ PXA_GPIO_TO_IRQ(PCM027_EGPIO_IRQ_GPIO)
#define PCM027_EGPIO_IRQ_EDGE IRQ_TYPE_EDGE_FALLING #define PCM027_EGPIO_IRQ_EDGE IRQ_TYPE_EDGE_FALLING
#define PCM027_EGPIO_CS 24 #define PCM027_EGPIO_CS 24
/* /*

Просмотреть файл

@ -28,14 +28,14 @@
/* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */ /* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */
#define PCM990_CTRL_INT_IRQ_GPIO 9 #define PCM990_CTRL_INT_IRQ_GPIO 9
#define PCM990_CTRL_INT_IRQ IRQ_GPIO(PCM990_CTRL_INT_IRQ_GPIO) #define PCM990_CTRL_INT_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_INT_IRQ_GPIO)
#define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING
#define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */ #define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */
#define PCM990_CTRL_BASE 0xea000000 #define PCM990_CTRL_BASE 0xea000000
#define PCM990_CTRL_SIZE (1*1024*1024) #define PCM990_CTRL_SIZE (1*1024*1024)
#define PCM990_CTRL_PWR_IRQ_GPIO 14 #define PCM990_CTRL_PWR_IRQ_GPIO 14
#define PCM990_CTRL_PWR_IRQ IRQ_GPIO(PCM990_CTRL_PWR_IRQ_GPIO) #define PCM990_CTRL_PWR_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_PWR_IRQ_GPIO)
#define PCM990_CTRL_PWR_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define PCM990_CTRL_PWR_IRQ_EDGE IRQ_TYPE_EDGE_RISING
/* visible CPLD (U7) registers */ /* visible CPLD (U7) registers */
@ -132,7 +132,7 @@
* IDE * IDE
*/ */
#define PCM990_IDE_IRQ_GPIO 13 #define PCM990_IDE_IRQ_GPIO 13
#define PCM990_IDE_IRQ IRQ_GPIO(PCM990_IDE_IRQ_GPIO) #define PCM990_IDE_IRQ PXA_GPIO_TO_IRQ(PCM990_IDE_IRQ_GPIO)
#define PCM990_IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define PCM990_IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING
#define PCM990_IDE_PLD_PHYS 0x20000000 /* 16 bit wide */ #define PCM990_IDE_PLD_PHYS 0x20000000 /* 16 bit wide */
#define PCM990_IDE_PLD_BASE 0xee000000 #define PCM990_IDE_PLD_BASE 0xee000000
@ -188,11 +188,11 @@
* Compact Flash * Compact Flash
*/ */
#define PCM990_CF_IRQ_GPIO 11 #define PCM990_CF_IRQ_GPIO 11
#define PCM990_CF_IRQ IRQ_GPIO(PCM990_CF_IRQ_GPIO) #define PCM990_CF_IRQ PXA_GPIO_TO_IRQ(PCM990_CF_IRQ_GPIO)
#define PCM990_CF_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define PCM990_CF_IRQ_EDGE IRQ_TYPE_EDGE_RISING
#define PCM990_CF_CD_GPIO 12 #define PCM990_CF_CD_GPIO 12
#define PCM990_CF_CD IRQ_GPIO(PCM990_CF_CD_GPIO) #define PCM990_CF_CD PXA_GPIO_TO_IRQ(PCM990_CF_CD_GPIO)
#define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING #define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING
#define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */ #define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */
@ -258,14 +258,14 @@
* Wolfson AC97 Touch * Wolfson AC97 Touch
*/ */
#define PCM990_AC97_IRQ_GPIO 10 #define PCM990_AC97_IRQ_GPIO 10
#define PCM990_AC97_IRQ IRQ_GPIO(PCM990_AC97_IRQ_GPIO) #define PCM990_AC97_IRQ PXA_GPIO_TO_IRQ(PCM990_AC97_IRQ_GPIO)
#define PCM990_AC97_IRQ_EDGE IRQ_TYPE_EDGE_RISING #define PCM990_AC97_IRQ_EDGE IRQ_TYPE_EDGE_RISING
/* /*
* MMC phyCORE * MMC phyCORE
*/ */
#define PCM990_MMC0_IRQ_GPIO 9 #define PCM990_MMC0_IRQ_GPIO 9
#define PCM990_MMC0_IRQ IRQ_GPIO(PCM990_MMC0_IRQ_GPIO) #define PCM990_MMC0_IRQ PXA_GPIO_TO_IRQ(PCM990_MMC0_IRQ_GPIO)
#define PCM990_MMC0_IRQ_EDGE IRQ_TYPE_EDGE_FALLING #define PCM990_MMC0_IRQ_EDGE IRQ_TYPE_EDGE_FALLING
/* /*

Просмотреть файл

@ -47,18 +47,18 @@
#define POODLE_GPIO_DISCHARGE_ON (42) /* Enable battery discharge */ #define POODLE_GPIO_DISCHARGE_ON (42) /* Enable battery discharge */
/* PXA GPIOs */ /* PXA GPIOs */
#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0) #define POODLE_IRQ_GPIO_ON_KEY PXA_GPIO_TO_IRQ(0)
#define POODLE_IRQ_GPIO_AC_IN IRQ_GPIO(1) #define POODLE_IRQ_GPIO_AC_IN PXA_GPIO_TO_IRQ(1)
#define POODLE_IRQ_GPIO_HP_IN IRQ_GPIO(4) #define POODLE_IRQ_GPIO_HP_IN PXA_GPIO_TO_IRQ(4)
#define POODLE_IRQ_GPIO_CO IRQ_GPIO(16) #define POODLE_IRQ_GPIO_CO PXA_GPIO_TO_IRQ(16)
#define POODLE_IRQ_GPIO_TP_INT IRQ_GPIO(5) #define POODLE_IRQ_GPIO_TP_INT PXA_GPIO_TO_IRQ(5)
#define POODLE_IRQ_GPIO_WAKEUP IRQ_GPIO(11) #define POODLE_IRQ_GPIO_WAKEUP PXA_GPIO_TO_IRQ(11)
#define POODLE_IRQ_GPIO_GA_INT IRQ_GPIO(10) #define POODLE_IRQ_GPIO_GA_INT PXA_GPIO_TO_IRQ(10)
#define POODLE_IRQ_GPIO_CF_IRQ IRQ_GPIO(17) #define POODLE_IRQ_GPIO_CF_IRQ PXA_GPIO_TO_IRQ(17)
#define POODLE_IRQ_GPIO_CF_CD IRQ_GPIO(14) #define POODLE_IRQ_GPIO_CF_CD PXA_GPIO_TO_IRQ(14)
#define POODLE_IRQ_GPIO_nSD_INT IRQ_GPIO(8) #define POODLE_IRQ_GPIO_nSD_INT PXA_GPIO_TO_IRQ(8)
#define POODLE_IRQ_GPIO_nSD_DETECT IRQ_GPIO(9) #define POODLE_IRQ_GPIO_nSD_DETECT PXA_GPIO_TO_IRQ(9)
#define POODLE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(13) #define POODLE_IRQ_GPIO_MAIN_BAT_LOW PXA_GPIO_TO_IRQ(13)
/* SCOOP GPIOs */ /* SCOOP GPIOs */
#define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11 #define POODLE_SCOOP_CHARGE_ON SCOOP_GPCR_PA11
@ -71,7 +71,7 @@
#define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT ) #define POODLE_SCOOP_IO_DIR ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
#define POODLE_SCOOP_IO_OUT ( 0 ) #define POODLE_SCOOP_IO_OUT ( 0 )
#define POODLE_SCOOP_GPIO_BASE (NR_BUILTIN_GPIO) #define POODLE_SCOOP_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
#define POODLE_GPIO_CHARGE_ON (POODLE_SCOOP_GPIO_BASE + 0) #define POODLE_GPIO_CHARGE_ON (POODLE_SCOOP_GPIO_BASE + 0)
#define POODLE_GPIO_CP401 (POODLE_SCOOP_GPIO_BASE + 2) #define POODLE_GPIO_CP401 (POODLE_SCOOP_GPIO_BASE + 2)
#define POODLE_GPIO_VPEN (POODLE_SCOOP_GPIO_BASE + 7) #define POODLE_GPIO_VPEN (POODLE_SCOOP_GPIO_BASE + 7)

Просмотреть файл

@ -108,7 +108,7 @@
#define SPITZ_SCP_SUS_CLR (SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON) #define SPITZ_SCP_SUS_CLR (SPITZ_SCP_MUTE_L | SPITZ_SCP_MUTE_R | SPITZ_SCP_JK_A | SPITZ_SCP_ADC_TEMP_ON)
#define SPITZ_SCP_SUS_SET 0 #define SPITZ_SCP_SUS_SET 0
#define SPITZ_SCP_GPIO_BASE (NR_BUILTIN_GPIO) #define SPITZ_SCP_GPIO_BASE (PXA_NR_BUILTIN_GPIO)
#define SPITZ_GPIO_LED_GREEN (SPITZ_SCP_GPIO_BASE + 0) #define SPITZ_GPIO_LED_GREEN (SPITZ_SCP_GPIO_BASE + 0)
#define SPITZ_GPIO_JK_B (SPITZ_SCP_GPIO_BASE + 1) #define SPITZ_GPIO_JK_B (SPITZ_SCP_GPIO_BASE + 1)
#define SPITZ_GPIO_CHRG_ON (SPITZ_SCP_GPIO_BASE + 2) #define SPITZ_GPIO_CHRG_ON (SPITZ_SCP_GPIO_BASE + 2)
@ -140,7 +140,7 @@
SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS) SPITZ_SCP2_BACKLIGHT_CONT | SPITZ_SCP2_BACKLIGHT_ON | SPITZ_SCP2_MIC_BIAS)
#define SPITZ_SCP2_SUS_SET (SPITZ_SCP2_IR_ON | SPITZ_SCP2_RESERVED_1) #define SPITZ_SCP2_SUS_SET (SPITZ_SCP2_IR_ON | SPITZ_SCP2_RESERVED_1)
#define SPITZ_SCP2_GPIO_BASE (NR_BUILTIN_GPIO + 12) #define SPITZ_SCP2_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 12)
#define SPITZ_GPIO_IR_ON (SPITZ_SCP2_GPIO_BASE + 0) #define SPITZ_GPIO_IR_ON (SPITZ_SCP2_GPIO_BASE + 0)
#define SPITZ_GPIO_AKIN_PULLUP (SPITZ_SCP2_GPIO_BASE + 1) #define SPITZ_GPIO_AKIN_PULLUP (SPITZ_SCP2_GPIO_BASE + 1)
#define SPITZ_GPIO_RESERVED_1 (SPITZ_SCP2_GPIO_BASE + 2) #define SPITZ_GPIO_RESERVED_1 (SPITZ_SCP2_GPIO_BASE + 2)
@ -152,7 +152,7 @@
#define SPITZ_GPIO_MIC_BIAS (SPITZ_SCP2_GPIO_BASE + 8) #define SPITZ_GPIO_MIC_BIAS (SPITZ_SCP2_GPIO_BASE + 8)
/* Akita IO Expander GPIOs */ /* Akita IO Expander GPIOs */
#define AKITA_IOEXP_GPIO_BASE (NR_BUILTIN_GPIO + 12) #define AKITA_IOEXP_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 12)
#define AKITA_GPIO_RESERVED_0 (AKITA_IOEXP_GPIO_BASE + 0) #define AKITA_GPIO_RESERVED_0 (AKITA_IOEXP_GPIO_BASE + 0)
#define AKITA_GPIO_RESERVED_1 (AKITA_IOEXP_GPIO_BASE + 1) #define AKITA_GPIO_RESERVED_1 (AKITA_IOEXP_GPIO_BASE + 1)
#define AKITA_GPIO_MIC_BIAS (AKITA_IOEXP_GPIO_BASE + 2) #define AKITA_GPIO_MIC_BIAS (AKITA_IOEXP_GPIO_BASE + 2)
@ -164,23 +164,23 @@
/* Spitz IRQ Definitions */ /* Spitz IRQ Definitions */
#define SPITZ_IRQ_GPIO_KEY_INT IRQ_GPIO(SPITZ_GPIO_KEY_INT) #define SPITZ_IRQ_GPIO_KEY_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_KEY_INT)
#define SPITZ_IRQ_GPIO_AC_IN IRQ_GPIO(SPITZ_GPIO_AC_IN) #define SPITZ_IRQ_GPIO_AC_IN PXA_GPIO_TO_IRQ(SPITZ_GPIO_AC_IN)
#define SPITZ_IRQ_GPIO_AK_INT IRQ_GPIO(SPITZ_GPIO_AK_INT) #define SPITZ_IRQ_GPIO_AK_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_AK_INT)
#define SPITZ_IRQ_GPIO_HP_IN IRQ_GPIO(SPITZ_GPIO_HP_IN) #define SPITZ_IRQ_GPIO_HP_IN PXA_GPIO_TO_IRQ(SPITZ_GPIO_HP_IN)
#define SPITZ_IRQ_GPIO_TP_INT IRQ_GPIO(SPITZ_GPIO_TP_INT) #define SPITZ_IRQ_GPIO_TP_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_TP_INT)
#define SPITZ_IRQ_GPIO_SYNC IRQ_GPIO(SPITZ_GPIO_SYNC) #define SPITZ_IRQ_GPIO_SYNC PXA_GPIO_TO_IRQ(SPITZ_GPIO_SYNC)
#define SPITZ_IRQ_GPIO_ON_KEY IRQ_GPIO(SPITZ_GPIO_ON_KEY) #define SPITZ_IRQ_GPIO_ON_KEY PXA_GPIO_TO_IRQ(SPITZ_GPIO_ON_KEY)
#define SPITZ_IRQ_GPIO_SWA IRQ_GPIO(SPITZ_GPIO_SWA) #define SPITZ_IRQ_GPIO_SWA PXA_GPIO_TO_IRQ(SPITZ_GPIO_SWA)
#define SPITZ_IRQ_GPIO_SWB IRQ_GPIO(SPITZ_GPIO_SWB) #define SPITZ_IRQ_GPIO_SWB PXA_GPIO_TO_IRQ(SPITZ_GPIO_SWB)
#define SPITZ_IRQ_GPIO_BAT_COVER IRQ_GPIO(SPITZ_GPIO_BAT_COVER) #define SPITZ_IRQ_GPIO_BAT_COVER PXA_GPIO_TO_IRQ(SPITZ_GPIO_BAT_COVER)
#define SPITZ_IRQ_GPIO_FATAL_BAT IRQ_GPIO(SPITZ_GPIO_FATAL_BAT) #define SPITZ_IRQ_GPIO_FATAL_BAT PXA_GPIO_TO_IRQ(SPITZ_GPIO_FATAL_BAT)
#define SPITZ_IRQ_GPIO_CO IRQ_GPIO(SPITZ_GPIO_CO) #define SPITZ_IRQ_GPIO_CO PXA_GPIO_TO_IRQ(SPITZ_GPIO_CO)
#define SPITZ_IRQ_GPIO_CF_IRQ IRQ_GPIO(SPITZ_GPIO_CF_IRQ) #define SPITZ_IRQ_GPIO_CF_IRQ PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF_IRQ)
#define SPITZ_IRQ_GPIO_CF_CD IRQ_GPIO(SPITZ_GPIO_CF_CD) #define SPITZ_IRQ_GPIO_CF_CD PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF_CD)
#define SPITZ_IRQ_GPIO_CF2_IRQ IRQ_GPIO(SPITZ_GPIO_CF2_IRQ) #define SPITZ_IRQ_GPIO_CF2_IRQ PXA_GPIO_TO_IRQ(SPITZ_GPIO_CF2_IRQ)
#define SPITZ_IRQ_GPIO_nSD_INT IRQ_GPIO(SPITZ_GPIO_nSD_INT) #define SPITZ_IRQ_GPIO_nSD_INT PXA_GPIO_TO_IRQ(SPITZ_GPIO_nSD_INT)
#define SPITZ_IRQ_GPIO_nSD_DETECT IRQ_GPIO(SPITZ_GPIO_nSD_DETECT) #define SPITZ_IRQ_GPIO_nSD_DETECT PXA_GPIO_TO_IRQ(SPITZ_GPIO_nSD_DETECT)
/* /*
* Shared data structures * Shared data structures

Просмотреть файл

@ -24,7 +24,7 @@
/* /*
* SCOOP2 internal GPIOs * SCOOP2 internal GPIOs
*/ */
#define TOSA_SCOOP_GPIO_BASE NR_BUILTIN_GPIO #define TOSA_SCOOP_GPIO_BASE PXA_NR_BUILTIN_GPIO
#define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11 #define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11
#define TOSA_GPIO_TC6393XB_REST_IN (TOSA_SCOOP_GPIO_BASE + 1) #define TOSA_GPIO_TC6393XB_REST_IN (TOSA_SCOOP_GPIO_BASE + 1)
#define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2) #define TOSA_GPIO_IR_POWERDWN (TOSA_SCOOP_GPIO_BASE + 2)
@ -42,7 +42,7 @@
/* /*
* SCOOP2 jacket GPIOs * SCOOP2 jacket GPIOs
*/ */
#define TOSA_SCOOP_JC_GPIO_BASE (NR_BUILTIN_GPIO + 12) #define TOSA_SCOOP_JC_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 12)
#define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0) #define TOSA_GPIO_BT_LED (TOSA_SCOOP_JC_GPIO_BASE + 0)
#define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1) #define TOSA_GPIO_NOTE_LED (TOSA_SCOOP_JC_GPIO_BASE + 1)
#define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2) #define TOSA_GPIO_CHRG_ERR_LED (TOSA_SCOOP_JC_GPIO_BASE + 2)
@ -59,7 +59,7 @@
/* /*
* TC6393XB GPIOs * TC6393XB GPIOs
*/ */
#define TOSA_TC6393XB_GPIO_BASE (NR_BUILTIN_GPIO + 2 * 12) #define TOSA_TC6393XB_GPIO_BASE (PXA_NR_BUILTIN_GPIO + 2 * 12)
#define TOSA_GPIO_TG_ON (TOSA_TC6393XB_GPIO_BASE + 0) #define TOSA_GPIO_TG_ON (TOSA_TC6393XB_GPIO_BASE + 0)
#define TOSA_GPIO_L_MUTE (TOSA_TC6393XB_GPIO_BASE + 1) #define TOSA_GPIO_L_MUTE (TOSA_TC6393XB_GPIO_BASE + 1)
@ -141,30 +141,30 @@
/* /*
* Interrupts * Interrupts
*/ */
#define TOSA_IRQ_GPIO_WAKEUP IRQ_GPIO(TOSA_GPIO_WAKEUP) #define TOSA_IRQ_GPIO_WAKEUP PXA_GPIO_TO_IRQ(TOSA_GPIO_WAKEUP)
#define TOSA_IRQ_GPIO_AC_IN IRQ_GPIO(TOSA_GPIO_AC_IN) #define TOSA_IRQ_GPIO_AC_IN PXA_GPIO_TO_IRQ(TOSA_GPIO_AC_IN)
#define TOSA_IRQ_GPIO_RECORD_BTN IRQ_GPIO(TOSA_GPIO_RECORD_BTN) #define TOSA_IRQ_GPIO_RECORD_BTN PXA_GPIO_TO_IRQ(TOSA_GPIO_RECORD_BTN)
#define TOSA_IRQ_GPIO_SYNC IRQ_GPIO(TOSA_GPIO_SYNC) #define TOSA_IRQ_GPIO_SYNC PXA_GPIO_TO_IRQ(TOSA_GPIO_SYNC)
#define TOSA_IRQ_GPIO_USB_IN IRQ_GPIO(TOSA_GPIO_USB_IN) #define TOSA_IRQ_GPIO_USB_IN PXA_GPIO_TO_IRQ(TOSA_GPIO_USB_IN)
#define TOSA_IRQ_GPIO_JACKET_DETECT IRQ_GPIO(TOSA_GPIO_JACKET_DETECT) #define TOSA_IRQ_GPIO_JACKET_DETECT PXA_GPIO_TO_IRQ(TOSA_GPIO_JACKET_DETECT)
#define TOSA_IRQ_GPIO_nSD_INT IRQ_GPIO(TOSA_GPIO_nSD_INT) #define TOSA_IRQ_GPIO_nSD_INT PXA_GPIO_TO_IRQ(TOSA_GPIO_nSD_INT)
#define TOSA_IRQ_GPIO_nSD_DETECT IRQ_GPIO(TOSA_GPIO_nSD_DETECT) #define TOSA_IRQ_GPIO_nSD_DETECT PXA_GPIO_TO_IRQ(TOSA_GPIO_nSD_DETECT)
#define TOSA_IRQ_GPIO_BAT1_CRG IRQ_GPIO(TOSA_GPIO_BAT1_CRG) #define TOSA_IRQ_GPIO_BAT1_CRG PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT1_CRG)
#define TOSA_IRQ_GPIO_CF_CD IRQ_GPIO(TOSA_GPIO_CF_CD) #define TOSA_IRQ_GPIO_CF_CD PXA_GPIO_TO_IRQ(TOSA_GPIO_CF_CD)
#define TOSA_IRQ_GPIO_BAT0_CRG IRQ_GPIO(TOSA_GPIO_BAT0_CRG) #define TOSA_IRQ_GPIO_BAT0_CRG PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT0_CRG)
#define TOSA_IRQ_GPIO_TC6393XB_INT IRQ_GPIO(TOSA_GPIO_TC6393XB_INT) #define TOSA_IRQ_GPIO_TC6393XB_INT PXA_GPIO_TO_IRQ(TOSA_GPIO_TC6393XB_INT)
#define TOSA_IRQ_GPIO_BAT0_LOW IRQ_GPIO(TOSA_GPIO_BAT0_LOW) #define TOSA_IRQ_GPIO_BAT0_LOW PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT0_LOW)
#define TOSA_IRQ_GPIO_EAR_IN IRQ_GPIO(TOSA_GPIO_EAR_IN) #define TOSA_IRQ_GPIO_EAR_IN PXA_GPIO_TO_IRQ(TOSA_GPIO_EAR_IN)
#define TOSA_IRQ_GPIO_CF_IRQ IRQ_GPIO(TOSA_GPIO_CF_IRQ) #define TOSA_IRQ_GPIO_CF_IRQ PXA_GPIO_TO_IRQ(TOSA_GPIO_CF_IRQ)
#define TOSA_IRQ_GPIO_ON_KEY IRQ_GPIO(TOSA_GPIO_ON_KEY) #define TOSA_IRQ_GPIO_ON_KEY PXA_GPIO_TO_IRQ(TOSA_GPIO_ON_KEY)
#define TOSA_IRQ_GPIO_VGA_LINE IRQ_GPIO(TOSA_GPIO_VGA_LINE) #define TOSA_IRQ_GPIO_VGA_LINE PXA_GPIO_TO_IRQ(TOSA_GPIO_VGA_LINE)
#define TOSA_IRQ_GPIO_TP_INT IRQ_GPIO(TOSA_GPIO_TP_INT) #define TOSA_IRQ_GPIO_TP_INT PXA_GPIO_TO_IRQ(TOSA_GPIO_TP_INT)
#define TOSA_IRQ_GPIO_JC_CF_IRQ IRQ_GPIO(TOSA_GPIO_JC_CF_IRQ) #define TOSA_IRQ_GPIO_JC_CF_IRQ PXA_GPIO_TO_IRQ(TOSA_GPIO_JC_CF_IRQ)
#define TOSA_IRQ_GPIO_BAT_LOCKED IRQ_GPIO(TOSA_GPIO_BAT_LOCKED) #define TOSA_IRQ_GPIO_BAT_LOCKED PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT_LOCKED)
#define TOSA_IRQ_GPIO_BAT1_LOW IRQ_GPIO(TOSA_GPIO_BAT1_LOW) #define TOSA_IRQ_GPIO_BAT1_LOW PXA_GPIO_TO_IRQ(TOSA_GPIO_BAT1_LOW)
#define TOSA_IRQ_GPIO_KEY_SENSE(a) IRQ_GPIO(69+(a)) #define TOSA_IRQ_GPIO_KEY_SENSE(a) PXA_GPIO_TO_IRQ(69+(a))
#define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW) #define TOSA_IRQ_GPIO_MAIN_BAT_LOW PXA_GPIO_TO_IRQ(TOSA_GPIO_MAIN_BAT_LOW)
#define TOSA_KEY_SYNC KEY_102ND /* ??? */ #define TOSA_KEY_SYNC KEY_102ND /* ??? */

Просмотреть файл

@ -43,30 +43,30 @@
/* Ethernet Controller Davicom DM9000 */ /* Ethernet Controller Davicom DM9000 */
#define GPIO_DM9000 101 #define GPIO_DM9000 101
#define TRIZEPS4_ETH_IRQ IRQ_GPIO(GPIO_DM9000) #define TRIZEPS4_ETH_IRQ PXA_GPIO_TO_IRQ(GPIO_DM9000)
/* UCB1400 audio / TS-controller */ /* UCB1400 audio / TS-controller */
#define GPIO_UCB1400 1 #define GPIO_UCB1400 1
#define TRIZEPS4_UCB1400_IRQ IRQ_GPIO(GPIO_UCB1400) #define TRIZEPS4_UCB1400_IRQ PXA_GPIO_TO_IRQ(GPIO_UCB1400)
/* PCMCIA socket Compact Flash */ /* PCMCIA socket Compact Flash */
#define GPIO_PCD 11 /* PCMCIA Card Detect */ #define GPIO_PCD 11 /* PCMCIA Card Detect */
#define TRIZEPS4_CD_IRQ IRQ_GPIO(GPIO_PCD) #define TRIZEPS4_CD_IRQ PXA_GPIO_TO_IRQ(GPIO_PCD)
#define GPIO_PRDY 13 /* READY / nINT */ #define GPIO_PRDY 13 /* READY / nINT */
#define TRIZEPS4_READY_NINT IRQ_GPIO(GPIO_PRDY) #define TRIZEPS4_READY_NINT PXA_GPIO_TO_IRQ(GPIO_PRDY)
/* MMC socket */ /* MMC socket */
#define GPIO_MMC_DET 12 #define GPIO_MMC_DET 12
#define TRIZEPS4_MMC_IRQ IRQ_GPIO(GPIO_MMC_DET) #define TRIZEPS4_MMC_IRQ PXA_GPIO_TO_IRQ(GPIO_MMC_DET)
/* DOC NAND chip */ /* DOC NAND chip */
#define GPIO_DOC_LOCK 94 #define GPIO_DOC_LOCK 94
#define GPIO_DOC_IRQ 93 #define GPIO_DOC_IRQ 93
#define TRIZEPS4_DOC_IRQ IRQ_GPIO(GPIO_DOC_IRQ) #define TRIZEPS4_DOC_IRQ PXA_GPIO_TO_IRQ(GPIO_DOC_IRQ)
/* SPI interface */ /* SPI interface */
#define GPIO_SPI 53 #define GPIO_SPI 53
#define TRIZEPS4_SPI_IRQ IRQ_GPIO(GPIO_SPI) #define TRIZEPS4_SPI_IRQ PXA_GPIO_TO_IRQ(GPIO_SPI)
/* LEDS using tx2 / rx2 */ /* LEDS using tx2 / rx2 */
#define GPIO_SYS_BUSY_LED 46 #define GPIO_SYS_BUSY_LED 46
@ -74,7 +74,7 @@
/* Off-module PIC on ConXS board */ /* Off-module PIC on ConXS board */
#define GPIO_PIC 0 #define GPIO_PIC 0
#define TRIZEPS4_PIC_IRQ IRQ_GPIO(GPIO_PIC) #define TRIZEPS4_PIC_IRQ PXA_GPIO_TO_IRQ(GPIO_PIC)
#ifdef CONFIG_MACH_TRIZEPS_CONXS #ifdef CONFIG_MACH_TRIZEPS_CONXS
/* for CONXS base board define these registers */ /* for CONXS base board define these registers */

Просмотреть файл

@ -22,7 +22,6 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/gpio-pxa.h>
#include "generic.h" #include "generic.h"
@ -92,44 +91,6 @@ static struct irq_chip pxa_internal_irq_chip = {
.irq_unmask = pxa_unmask_irq, .irq_unmask = pxa_unmask_irq,
}; };
/*
* GPIO IRQs for GPIO 0 and 1
*/
static int pxa_set_low_gpio_type(struct irq_data *d, unsigned int type)
{
int gpio = d->irq - IRQ_GPIO0;
if (__gpio_is_occupied(gpio)) {
pr_err("%s failed: GPIO is configured\n", __func__);
return -EINVAL;
}
if (type & IRQ_TYPE_EDGE_RISING)
GRER0 |= GPIO_bit(gpio);
else
GRER0 &= ~GPIO_bit(gpio);
if (type & IRQ_TYPE_EDGE_FALLING)
GFER0 |= GPIO_bit(gpio);
else
GFER0 &= ~GPIO_bit(gpio);
return 0;
}
static void pxa_ack_low_gpio(struct irq_data *d)
{
GEDR0 = (1 << (d->irq - IRQ_GPIO0));
}
static struct irq_chip pxa_low_gpio_chip = {
.name = "GPIO-l",
.irq_ack = pxa_ack_low_gpio,
.irq_mask = pxa_mask_irq,
.irq_unmask = pxa_unmask_irq,
.irq_set_type = pxa_set_low_gpio_type,
};
asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs) asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs)
{ {
uint32_t icip, icmr, mask; uint32_t icip, icmr, mask;
@ -160,26 +121,7 @@ asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs)
} while (1); } while (1);
} }
static void __init pxa_init_low_gpio_irq(set_wake_t fn) void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int))
{
int irq;
/* clear edge detection on GPIO 0 and 1 */
GFER0 &= ~0x3;
GRER0 &= ~0x3;
GEDR0 = 0x3;
for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
irq_set_chip_and_handler(irq, &pxa_low_gpio_chip,
handle_edge_irq);
irq_set_chip_data(irq, irq_base(0));
set_irq_flags(irq, IRQF_VALID);
}
pxa_low_gpio_chip.irq_set_wake = fn;
}
void __init pxa_init_irq(int irq_nr, set_wake_t fn)
{ {
int irq, i, n; int irq, i, n;
@ -209,7 +151,6 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
__raw_writel(1, irq_base(0) + ICCR); __raw_writel(1, irq_base(0) + ICCR);
pxa_internal_irq_chip.irq_set_wake = fn; pxa_internal_irq_chip.irq_set_wake = fn;
pxa_init_low_gpio_irq(fn);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM

Просмотреть файл

@ -124,8 +124,8 @@ static struct resource smc91x_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)), .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)),
.end = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
} }
}; };
@ -396,7 +396,7 @@ static struct i2c_board_info littleton_i2c_info[] = {
.type = "da9034", .type = "da9034",
.addr = 0x34, .addr = 0x34,
.platform_data = &littleton_da9034_info, .platform_data = &littleton_da9034_info,
.irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO18)), .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO18)),
}, },
[1] = { [1] = {
.type = "max7320", .type = "max7320",

Просмотреть файл

@ -152,8 +152,8 @@ static void __init lpd270_init_irq(void)
handle_level_irq); handle_level_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
} }
irq_set_chained_handler(IRQ_GPIO(0), lpd270_irq_handler); irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lpd270_irq_handler);
irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING); irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
} }

Просмотреть файл

@ -170,8 +170,8 @@ static void __init lubbock_init_irq(void)
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
} }
irq_set_chained_handler(IRQ_GPIO(0), lubbock_irq_handler); irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), lubbock_irq_handler);
irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING); irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM

Просмотреть файл

@ -184,8 +184,8 @@ static struct resource egpio_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ), .start = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
.end = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
@ -468,8 +468,8 @@ static struct resource pasic3_resources[] = {
}, },
/* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */ /* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */
[1] = { [1] = {
.start = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ), .start = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
.end = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
} }
}; };

Просмотреть файл

@ -178,8 +178,8 @@ static void __init mainstone_init_irq(void)
MST_INTMSKENA = 0; MST_INTMSKENA = 0;
MST_INTSETCLR = 0; MST_INTSETCLR = 0;
irq_set_chained_handler(IRQ_GPIO(0), mainstone_irq_handler); irq_set_chained_handler(PXA_GPIO_TO_IRQ(0), mainstone_irq_handler);
irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING); irq_set_irq_type(PXA_GPIO_TO_IRQ(0), IRQ_TYPE_EDGE_FALLING);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM

Просмотреть файл

@ -13,6 +13,7 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/gpio-pxa.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
@ -20,7 +21,6 @@
#include <mach/pxa2xx-regs.h> #include <mach/pxa2xx-regs.h>
#include <mach/mfp-pxa2xx.h> #include <mach/mfp-pxa2xx.h>
#include <mach/gpio-pxa.h>
#include "generic.h" #include "generic.h"
@ -29,6 +29,10 @@
#define GAFR_L(x) __GAFR(0, x) #define GAFR_L(x) __GAFR(0, x)
#define GAFR_U(x) __GAFR(1, x) #define GAFR_U(x) __GAFR(1, x)
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
#define GPLR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5))
#define GPDR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x0c)
#define PWER_WE35 (1 << 24) #define PWER_WE35 (1 << 24)
struct gpio_desc { struct gpio_desc {

Просмотреть файл

@ -537,15 +537,15 @@ static struct pda_power_pdata power_pdata = {
static struct resource power_resources[] = { static struct resource power_resources[] = {
[0] = { [0] = {
.name = "ac", .name = "ac",
.start = gpio_to_irq(GPIO96_AC_DETECT), .start = PXA_GPIO_TO_IRQ(GPIO96_AC_DETECT),
.end = gpio_to_irq(GPIO96_AC_DETECT), .end = PXA_GPIO_TO_IRQ(GPIO96_AC_DETECT),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
IORESOURCE_IRQ_LOWEDGE, IORESOURCE_IRQ_LOWEDGE,
}, },
[1] = { [1] = {
.name = "usb", .name = "usb",
.start = gpio_to_irq(GPIO13_nUSB_DETECT), .start = PXA_GPIO_TO_IRQ(GPIO13_nUSB_DETECT),
.end = gpio_to_irq(GPIO13_nUSB_DETECT), .end = PXA_GPIO_TO_IRQ(GPIO13_nUSB_DETECT),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
IORESOURCE_IRQ_LOWEDGE, IORESOURCE_IRQ_LOWEDGE,
}, },

Просмотреть файл

@ -417,8 +417,8 @@ static struct resource dm9k_resources[] = {
.flags = IORESOURCE_MEM .flags = IORESOURCE_MEM
}, },
[2] = { [2] = {
.start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)), .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
.end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)), .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO9)),
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
} }
}; };

Просмотреть файл

@ -378,7 +378,7 @@ struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
#include <linux/i2c/pca953x.h> #include <linux/i2c/pca953x.h>
static struct pca953x_platform_data pca9536_data = { static struct pca953x_platform_data pca9536_data = {
.gpio_base = NR_BUILTIN_GPIO, .gpio_base = PXA_NR_BUILTIN_GPIO,
}; };
static int gpio_bus_switch = -EINVAL; static int gpio_bus_switch = -EINVAL;
@ -406,9 +406,9 @@ static unsigned long pcm990_camera_query_bus_param(struct soc_camera_link *link)
int ret; int ret;
if (gpio_bus_switch < 0) { if (gpio_bus_switch < 0) {
ret = gpio_request(NR_BUILTIN_GPIO, "camera"); ret = gpio_request(PXA_NR_BUILTIN_GPIO, "camera");
if (!ret) { if (!ret) {
gpio_bus_switch = NR_BUILTIN_GPIO; gpio_bus_switch = PXA_NR_BUILTIN_GPIO;
gpio_direction_output(gpio_bus_switch, 0); gpio_direction_output(gpio_bus_switch, 0);
} }
} }

Просмотреть файл

@ -166,8 +166,8 @@ static struct resource locomo_resources[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
.start = IRQ_GPIO(10), .start = PXA_GPIO_TO_IRQ(10),
.end = IRQ_GPIO(10), .end = PXA_GPIO_TO_IRQ(10),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
@ -212,7 +212,7 @@ static struct spi_board_info poodle_spi_devices[] = {
.bus_num = 1, .bus_num = 1,
.platform_data = &poodle_ads7846_info, .platform_data = &poodle_ads7846_info,
.controller_data= &poodle_ads7846_chip, .controller_data= &poodle_ads7846_chip,
.irq = gpio_to_irq(POODLE_GPIO_TP_INT), .irq = PXA_GPIO_TO_IRQ(POODLE_GPIO_TP_INT),
}, },
}; };

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше