Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54031
b: refs/heads/master
c: 69f4f33
h: refs/heads/master
i:
  54029: e71f233
  54027: 0273716
  54023: 8f9e3c6
  54015: c905af7
v: v3
  • Loading branch information
Russell King authored and Russell King committed May 3, 2007
1 parent bf60d43 commit f82a9e8
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 159 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7053acbd78336abf5d4bc3d8a875a03624cfb83f
refs/heads/master: 69f4f331a0f78470f0bc42ba8db8d6cdd9cae4a9
2 changes: 1 addition & 1 deletion trunk/Documentation/spi/pxa2xx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static struct resource pxa_spi_nssp_resources[] = {

static struct pxa2xx_spi_master pxa_nssp_master_info = {
.ssp_type = PXA25x_NSSP, /* Type of SSP */
.clock_enable = CKEN_NSSP, /* NSSP Peripheral clock */
.clock_enable = CKEN9_NSSP, /* NSSP Peripheral clock */
.num_chipselect = 1, /* Matches the number of chips attached to NSSP */
.enable_dma = 1, /* Enables NSSP DMA */
};
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/kernel/ecard.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
ec->dev.bus = &ecard_bus_type;
ec->dev.dma_mask = &ec->dma_mask;
ec->dma_mask = (u64)0xffffffff;
ec->dev.coherent_dma_mask = ec->dma_mask;

if (slot < 4) {
ec_set_resource(ec, ECARD_RES_MEMC,
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-pxa/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ void pxa_set_cken(int clock, int enable)
local_irq_save(flags);

if (enable)
CKEN |= (1 << clock);
CKEN |= clock;
else
CKEN &= ~(1 << clock);
CKEN &= ~clock;

local_irq_restore(flags);
}
Expand Down
72 changes: 2 additions & 70 deletions trunk/arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,11 @@ static void pxa_unmask_low_irq(unsigned int irq)
ICMR |= (1 << (irq + PXA_IRQ_SKIP));
}

static int pxa_set_wake(unsigned int irq, unsigned int on)
{
u32 mask;

switch (irq) {
case IRQ_RTCAlrm:
mask = PWER_RTC;
break;
#ifdef CONFIG_PXA27x
/* REVISIT can handle USBH1, USBH2, USB, MSL, USIM, ... */
#endif
default:
return -EINVAL;
}
if (on)
PWER |= mask;
else
PWER &= ~mask;
return 0;
}

static struct irq_chip pxa_internal_chip_low = {
.name = "SC",
.ack = pxa_mask_low_irq,
.mask = pxa_mask_low_irq,
.unmask = pxa_unmask_low_irq,
.set_wake = pxa_set_wake,
};

#if PXA_INTERNAL_IRQS > 32
Expand Down Expand Up @@ -92,26 +70,6 @@ static struct irq_chip pxa_internal_chip_high = {

#endif

/* Note that if an input/irq line ever gets changed to an output during
* suspend, the relevant PWER, PRER, and PFER bits should be cleared.
*/
#ifdef CONFIG_PXA27x

/* PXA27x: Various gpios can issue wakeup events. This logic only
* handles the simple cases, not the WEMUX2 and WEMUX3 options
*/
#define PXA27x_GPIO_NOWAKE_MASK \
((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2))
#define WAKEMASK(gpio) \
(((gpio) <= 15) \
? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \
: ((gpio == 35) ? (1 << 24) : 0))
#else

/* pxa 210, 250, 255, 26x: gpios 0..15 can issue wakeups */
#define WAKEMASK(gpio) (((gpio) <= 15) ? (1 << (gpio)) : 0)
#endif

/*
* PXA GPIO edge detection for IRQs:
* IRQs are generated on Falling-Edge, Rising-Edge, or both.
Expand All @@ -125,11 +83,9 @@ static long GPIO_IRQ_mask[4];
static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
{
int gpio, idx;
u32 mask;

gpio = IRQ_TO_GPIO(irq);
idx = gpio >> 5;
mask = WAKEMASK(gpio);

if (type == IRQT_PROBE) {
/* Don't mess with enabled GPIOs using preconfigured edges or
Expand All @@ -149,20 +105,14 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
if (type & __IRQT_RISEDGE) {
/* printk("rising "); */
__set_bit (gpio, GPIO_IRQ_rising_edge);
PRER |= mask;
} else {
} else
__clear_bit (gpio, GPIO_IRQ_rising_edge);
PRER &= ~mask;
}

if (type & __IRQT_FALEDGE) {
/* printk("falling "); */
__set_bit (gpio, GPIO_IRQ_falling_edge);
PFER |= mask;
} else {
} else
__clear_bit (gpio, GPIO_IRQ_falling_edge);
PFER &= ~mask;
}

/* printk("edges\n"); */

Expand All @@ -180,29 +130,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
GEDR0 = (1 << (irq - IRQ_GPIO0));
}

static int pxa_set_gpio_wake(unsigned int irq, unsigned int on)
{
int gpio = IRQ_TO_GPIO(irq);
u32 mask = WAKEMASK(gpio);

if (!mask)
return -EINVAL;

if (on)
PWER |= mask;
else
PWER &= ~mask;
return 0;
}


static struct irq_chip pxa_low_gpio_chip = {
.name = "GPIO-l",
.ack = pxa_ack_low_gpio,
.mask = pxa_mask_low_irq,
.unmask = pxa_unmask_low_irq,
.set_type = pxa_gpio_irq_type,
.set_wake = pxa_set_gpio_wake,
};

/*
Expand Down Expand Up @@ -311,7 +244,6 @@ static struct irq_chip pxa_muxed_gpio_chip = {
.mask = pxa_mask_muxed_gpio,
.unmask = pxa_unmask_muxed_gpio,
.set_type = pxa_gpio_irq_type,
.set_wake = pxa_set_gpio_wake,
};


Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-pxa/lpd270.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ static void lpd270_backlight_power(int on)
{
if (on) {
pxa_gpio_mode(GPIO16_PWM0_MD);
pxa_set_cken(CKEN_PWM0, 1);
pxa_set_cken(CKEN0_PWM0, 1);
PWM_CTRL0 = 0;
PWM_PWDUTY0 = 0x3ff;
PWM_PERVAL0 = 0x3ff;
} else {
PWM_CTRL0 = 0;
PWM_PWDUTY0 = 0x0;
PWM_PERVAL0 = 0x3FF;
pxa_set_cken(CKEN_PWM0, 0);
pxa_set_cken(CKEN0_PWM0, 0);
}
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-pxa/lubbock.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static struct resource pxa_ssp_resources[] = {

static struct pxa2xx_spi_master pxa_ssp_master_info = {
.ssp_type = PXA25x_SSP,
.clock_enable = CKEN_SSP,
.clock_enable = CKEN3_SSP,
.num_chipselect = 0,
};

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-pxa/mainstone.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ static void mainstone_backlight_power(int on)
{
if (on) {
pxa_gpio_mode(GPIO16_PWM0_MD);
pxa_set_cken(CKEN_PWM0, 1);
pxa_set_cken(CKEN0_PWM0, 1);
PWM_CTRL0 = 0;
PWM_PWDUTY0 = 0x3ff;
PWM_PERVAL0 = 0x3ff;
} else {
PWM_CTRL0 = 0;
PWM_PWDUTY0 = 0x0;
PWM_PERVAL0 = 0x3FF;
pxa_set_cken(CKEN_PWM0, 0);
pxa_set_cken(CKEN0_PWM0, 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ void pxa_cpu_pm_enter(suspend_state_t state)
extern void pxa_cpu_resume(void);

if (state == PM_SUSPEND_STANDBY)
CKEN = CKEN_MEMC | CKEN_OSTIMER | CKEN_LCD | CKEN_PWM0;
CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0;
else
CKEN = CKEN_MEMC | CKEN_OSTIMER;
CKEN = CKEN22_MEMC | CKEN9_OSTIMER;

/* ensure voltage-change sequencer not initiated, which hangs */
PCFR &= ~PCFR_FVC;
Expand Down
12 changes: 6 additions & 6 deletions trunk/arch/arm/mach-pxa/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ struct ssp_info_ {
*/
static const struct ssp_info_ ssp_info[PXA_SSP_PORTS] = {
#if defined (CONFIG_PXA27x)
{IRQ_SSP, CKEN_SSP1},
{IRQ_SSP2, CKEN_SSP2},
{IRQ_SSP3, CKEN_SSP3},
{IRQ_SSP, CKEN23_SSP1},
{IRQ_SSP2, CKEN3_SSP2},
{IRQ_SSP3, CKEN4_SSP3},
#else
{IRQ_SSP, CKEN_SSP},
{IRQ_NSSP, CKEN_NSSP},
{IRQ_ASSP, CKEN_ASSP},
{IRQ_SSP, CKEN3_SSP},
{IRQ_NSSP, CKEN9_NSSP},
{IRQ_ASSP, CKEN10_ASSP},
#endif
};

Expand Down
18 changes: 8 additions & 10 deletions trunk/drivers/i2c/busses/i2c-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,9 @@ static int i2c_pxa_probe(struct platform_device *dev)
{
struct pxa_i2c *i2c = &i2c_pxa;
struct resource *res;
#ifdef CONFIG_I2C_PXA_SLAVE
struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
#endif
int ret;
int irq;

Expand Down Expand Up @@ -887,14 +889,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
pxa_gpio_mode(GPIO117_I2CSCL_MD);
pxa_gpio_mode(GPIO118_I2CSDA_MD);
#endif
pxa_set_cken(CKEN_I2C, 1);
pxa_set_cken(CKEN14_I2C, 1);
break;
#ifdef CONFIG_PXA27x
case 1:
local_irq_disable();
PCFR |= PCFR_PI2CEN;
local_irq_enable();
pxa_set_cken(CKEN_PWRI2C, 1);
pxa_set_cken(CKEN15_PWRI2C, 1);
#endif
}

Expand All @@ -909,10 +911,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c->adap.algo_data = i2c;
i2c->adap.dev.parent = &dev->dev;

if (plat) {
i2c->adap.class = plat->class;
}

ret = i2c_add_adapter(&i2c->adap);
if (ret < 0) {
printk(KERN_INFO "I2C: Failed to add bus\n");
Expand All @@ -935,11 +933,11 @@ static int i2c_pxa_probe(struct platform_device *dev)
ereqirq:
switch (dev->id) {
case 0:
pxa_set_cken(CKEN_I2C, 0);
pxa_set_cken(CKEN14_I2C, 0);
break;
#ifdef CONFIG_PXA27x
case 1:
pxa_set_cken(CKEN_PWRI2C, 0);
pxa_set_cken(CKEN15_PWRI2C, 0);
local_irq_disable();
PCFR &= ~PCFR_PI2CEN;
local_irq_enable();
Expand All @@ -962,11 +960,11 @@ static int i2c_pxa_remove(struct platform_device *dev)
free_irq(i2c->irq, i2c);
switch (dev->id) {
case 0:
pxa_set_cken(CKEN_I2C, 0);
pxa_set_cken(CKEN14_I2C, 0);
break;
#ifdef CONFIG_PXA27x
case 1:
pxa_set_cken(CKEN_PWRI2C, 0);
pxa_set_cken(CKEN15_PWRI2C, 0);
local_irq_disable();
PCFR &= ~PCFR_PI2CEN;
local_irq_enable();
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/mmc/pxamci.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,14 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (CLOCKRATE / clk > ios->clock)
clk <<= 1;
host->clkrt = fls(clk) - 1;
pxa_set_cken(CKEN_MMC, 1);
pxa_set_cken(CKEN12_MMC, 1);

/*
* we write clkrt on the next command
*/
} else {
pxamci_stop_clock(host);
pxa_set_cken(CKEN_MMC, 0);
pxa_set_cken(CKEN12_MMC, 0);
}

if (host->power_mode != ios->power_mode) {
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/net/irda/pxaficp_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
DCSR(si->rxdma) &= ~DCSR_RUN;
/* disable FICP */
ICCR0 = 0;
pxa_set_cken(CKEN_FICP, 0);
pxa_set_cken(CKEN13_FICP, 0);

/* set board transceiver to SIR mode */
si->pdata->transceiver_mode(si->dev, IR_SIRMODE);
Expand All @@ -144,7 +144,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
pxa_gpio_mode(GPIO47_STTXD_MD);

/* enable the STUART clock */
pxa_set_cken(CKEN_STUART, 1);
pxa_set_cken(CKEN5_STUART, 1);
}

/* disable STUART first */
Expand All @@ -169,7 +169,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
/* disable STUART */
STIER = 0;
STISR = 0;
pxa_set_cken(CKEN_STUART, 0);
pxa_set_cken(CKEN5_STUART, 0);

/* disable FICP first */
ICCR0 = 0;
Expand All @@ -182,7 +182,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
pxa_gpio_mode(GPIO47_ICPTXD_MD);

/* enable the FICP clock */
pxa_set_cken(CKEN_FICP, 1);
pxa_set_cken(CKEN13_FICP, 1);

si->speed = speed;
pxa_irda_fir_dma_rx_start(si);
Expand Down Expand Up @@ -593,15 +593,15 @@ static void pxa_irda_shutdown(struct pxa_irda *si)
/* disable STUART SIR mode */
STISR = 0;
/* disable the STUART clock */
pxa_set_cken(CKEN_STUART, 0);
pxa_set_cken(CKEN5_STUART, 0);

/* disable DMA */
DCSR(si->txdma) &= ~DCSR_RUN;
DCSR(si->rxdma) &= ~DCSR_RUN;
/* disable FICP */
ICCR0 = 0;
/* disable the FICP clock */
pxa_set_cken(CKEN_FICP, 0);
pxa_set_cken(CKEN13_FICP, 0);

DRCMR17 = 0;
DRCMR18 = 0;
Expand Down
Loading

0 comments on commit f82a9e8

Please sign in to comment.