Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100929
b: refs/heads/master
c: fdc614e
h: refs/heads/master
i:
  100927: 060bada
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jul 9, 2008
1 parent f26bc21 commit 8abc294
Show file tree
Hide file tree
Showing 30 changed files with 941 additions and 114 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: 9fc697b0b01416edae99dd9c5c49fb69c9282744
refs/heads/master: fdc614e873bc56ed15d8f4e9fa33516cd0915fc2
3 changes: 3 additions & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ config ARM
Europe. There is an ARM Linux project with a web page at
<http://www.arm.linux.org.uk/>.

config HAVE_PWM
bool

config SYS_SUPPORTS_APM_EMULATION
bool

Expand Down
25 changes: 25 additions & 0 deletions trunk/arch/arm/mach-pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ config ARCH_LUBBOCK
config MACH_LOGICPD_PXA270
bool "LogicPD PXA270 Card Engine Development Platform"
select PXA27x
select HAVE_PWM

config MACH_MAINSTONE
bool "Intel HCDDBBVA0 Development Platform"
select PXA27x
select HAVE_PWM

config ARCH_PXA_IDP
bool "Accelent Xscale IDP"
Expand Down Expand Up @@ -115,6 +117,7 @@ config MACH_COLIBRI
config MACH_ZYLONITE
bool "PXA3xx Development Platform"
select PXA3xx
select HAVE_PWM

config MACH_LITTLETON
bool "PXA3xx Form Factor Platform (aka Littleton)"
Expand Down Expand Up @@ -145,6 +148,22 @@ choice

config MACH_PCM990_BASEBOARD
bool "PHYTEC PCM-990 development board"
select HAVE_PWM

endchoice

choice
prompt "display on pcm990"
depends on MACH_PCM990_BASEBOARD

config PCM990_DISPLAY_SHARP
bool "sharp lq084v1dg21 stn display"

config PCM990_DISPLAY_NEC
bool "nec nl6448bc20_18d tft display"

config PCM990_DISPLAY_NONE
bool "no display"

endchoice

Expand Down Expand Up @@ -263,4 +282,10 @@ config PXA_SSP
tristate
help
Enable support for PXA2xx SSP ports

config PXA_PWM
tristate
default BACKLIGHT_PWM
help
Enable support for PXA2xx/PXA3xx PWM controllers
endif
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-pxa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ obj-$(CONFIG_CPU_FREQ) += cpu-pxa.o

# Generic drivers that other drivers may depend upon
obj-$(CONFIG_PXA_SSP) += ssp.o
obj-$(CONFIG_PXA_PWM) += pwm.o

# SoC-specific code
obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa25x.o
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-pxa/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ struct clk *clk_get(struct device *dev, const char *id)
clk = p;
mutex_unlock(&clocks_mutex);

if (!IS_ERR(clk) && clk->ops == NULL)
clk = clk->other;

return clk;
}
EXPORT_SYMBOL(clk_get);
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/arm/mach-pxa/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct clk {
unsigned int cken;
unsigned int delay;
unsigned int enabled;
struct clk *other;
};

#define INIT_CKEN(_name, _cken, _rate, _delay, _dev) \
Expand All @@ -35,6 +36,17 @@ struct clk {
.cken = CKEN_##_cken, \
}

/*
* This is a placeholder to alias one clock device+name pair
* to another struct clk.
*/
#define INIT_CKOTHER(_name, _other, _dev) \
{ \
.name = _name, \
.dev = _dev, \
.other = _other, \
}

extern const struct clkops clk_cken_ops;

void clk_cken_enable(struct clk *clk);
Expand Down
60 changes: 60 additions & 0 deletions trunk/arch/arm/mach-pxa/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,36 @@ struct platform_device pxa_device_rtc = {

#ifdef CONFIG_PXA25x

static struct resource pxa25x_resource_pwm0[] = {
[0] = {
.start = 0x40b00000,
.end = 0x40b0000f,
.flags = IORESOURCE_MEM,
},
};

struct platform_device pxa25x_device_pwm0 = {
.name = "pxa25x-pwm",
.id = 0,
.resource = pxa25x_resource_pwm0,
.num_resources = ARRAY_SIZE(pxa25x_resource_pwm0),
};

static struct resource pxa25x_resource_pwm1[] = {
[0] = {
.start = 0x40c00000,
.end = 0x40c0000f,
.flags = IORESOURCE_MEM,
},
};

struct platform_device pxa25x_device_pwm1 = {
.name = "pxa25x-pwm",
.id = 1,
.resource = pxa25x_resource_pwm1,
.num_resources = ARRAY_SIZE(pxa25x_resource_pwm1),
};

static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);

static struct resource pxa25x_resource_ssp[] = {
Expand Down Expand Up @@ -577,6 +607,36 @@ struct platform_device pxa27x_device_ssp3 = {
.num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
};

static struct resource pxa27x_resource_pwm0[] = {
[0] = {
.start = 0x40b00000,
.end = 0x40b0001f,
.flags = IORESOURCE_MEM,
},
};

struct platform_device pxa27x_device_pwm0 = {
.name = "pxa27x-pwm",
.id = 0,
.resource = pxa27x_resource_pwm0,
.num_resources = ARRAY_SIZE(pxa27x_resource_pwm0),
};

static struct resource pxa27x_resource_pwm1[] = {
[0] = {
.start = 0x40c00000,
.end = 0x40c0001f,
.flags = IORESOURCE_MEM,
},
};

struct platform_device pxa27x_device_pwm1 = {
.name = "pxa27x-pwm",
.id = 1,
.resource = pxa27x_resource_pwm1,
.num_resources = ARRAY_SIZE(pxa27x_resource_pwm1),
};

static struct resource pxa27x_resource_camera[] = {
[0] = {
.start = 0x50000000,
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/arm/mach-pxa/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ extern struct platform_device pxa27x_device_ssp2;
extern struct platform_device pxa27x_device_ssp3;
extern struct platform_device pxa3xx_device_ssp4;

extern struct platform_device pxa25x_device_pwm0;
extern struct platform_device pxa25x_device_pwm1;
extern struct platform_device pxa27x_device_pwm0;
extern struct platform_device pxa27x_device_pwm1;

void __init pxa_register_device(struct platform_device *dev, void *data);
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <asm/irq.h>
#include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-gpio.h>

#include "generic.h"

Expand Down
38 changes: 17 additions & 21 deletions trunk/arch/arm/mach-pxa/lpd270.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/ioport.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/pwm_backlight.h>

#include <asm/types.h>
#include <asm/setup.h>
Expand Down Expand Up @@ -236,21 +237,20 @@ static struct platform_device lpd270_flash_device[2] = {
},
};

static void lpd270_backlight_power(int on)
{
if (on) {
pxa_gpio_mode(GPIO16_PWM0_MD);
pxa_set_cken(CKEN_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);
}
}
static struct platform_pwm_backlight_data lpd270_backlight_data = {
.pwm_id = 0,
.max_brightness = 1,
.dft_brightness = 1,
.pwm_period_ns = 78770,
};

static struct platform_device lpd270_backlight_device = {
.name = "pwm-backlight",
.dev = {
.parent = &pxa27x_device_pwm0.dev,
.platform_data = &lpd270_backlight_data,
},
};

/* 5.7" TFT QVGA (LoLo display number 1) */
static struct pxafb_mode_info sharp_lq057q3dc02_mode = {
Expand All @@ -272,7 +272,6 @@ static struct pxafb_mach_info sharp_lq057q3dc02 = {
.num_modes = 1,
.lccr0 = 0x07800080,
.lccr3 = 0x00400000,
.pxafb_backlight_power = lpd270_backlight_power,
};

/* 12.1" TFT SVGA (LoLo display number 2) */
Expand All @@ -295,7 +294,6 @@ static struct pxafb_mach_info sharp_lq121s1dg31 = {
.num_modes = 1,
.lccr0 = 0x07800080,
.lccr3 = 0x00400000,
.pxafb_backlight_power = lpd270_backlight_power,
};

/* 3.6" TFT QVGA (LoLo display number 3) */
Expand All @@ -318,7 +316,6 @@ static struct pxafb_mach_info sharp_lq036q1da01 = {
.num_modes = 1,
.lccr0 = 0x07800080,
.lccr3 = 0x00400000,
.pxafb_backlight_power = lpd270_backlight_power,
};

/* 6.4" TFT VGA (LoLo display number 5) */
Expand All @@ -341,7 +338,6 @@ static struct pxafb_mach_info sharp_lq64d343 = {
.num_modes = 1,
.lccr0 = 0x07800080,
.lccr3 = 0x00400000,
.pxafb_backlight_power = lpd270_backlight_power,
};

/* 10.4" TFT VGA (LoLo display number 7) */
Expand All @@ -364,7 +360,6 @@ static struct pxafb_mach_info sharp_lq10d368 = {
.num_modes = 1,
.lccr0 = 0x07800080,
.lccr3 = 0x00400000,
.pxafb_backlight_power = lpd270_backlight_power,
};

/* 3.5" TFT QVGA (LoLo display number 8) */
Expand All @@ -387,7 +382,6 @@ static struct pxafb_mach_info sharp_lq035q7db02_20 = {
.num_modes = 1,
.lccr0 = 0x07800080,
.lccr3 = 0x00400000,
.pxafb_backlight_power = lpd270_backlight_power,
};

static struct pxafb_mach_info *lpd270_lcd_to_use;
Expand Down Expand Up @@ -417,6 +411,7 @@ __setup("lcd=", lpd270_set_lcd);

static struct platform_device *platform_devices[] __initdata = {
&smc91x_device,
&lpd270_backlight_device,
&lpd270_audio_device,
&lpd270_flash_device[0],
&lpd270_flash_device[1],
Expand Down Expand Up @@ -457,6 +452,7 @@ static void __init lpd270_init(void)
* On LogicPD PXA270, we route AC97_SYSCLK via GPIO45.
*/
pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
pxa_gpio_mode(GPIO16_PWM0_MD);

platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));

Expand Down
Loading

0 comments on commit 8abc294

Please sign in to comment.