Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100912
b: refs/heads/master
c: 02a8e76
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed May 19, 2008
1 parent 2d51399 commit 5c9b0c1
Show file tree
Hide file tree
Showing 26 changed files with 116 additions and 862 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: c0f7edb3099d538017c52556aab596b857dc92ee
refs/heads/master: 02a8e76979f9b439642e67955edb865c112926f6
3 changes: 0 additions & 3 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ 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
2 changes: 2 additions & 0 deletions trunk/arch/arm/common/sharpsl_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
dev_dbg(sharpsl_pm.dev, "Battery: voltage: %d, status: %d, percentage: %d, time: %ld\n", voltage,
sharpsl_pm.battstat.mainbat_status, sharpsl_pm.battstat.mainbat_percent, jiffies);

#ifdef CONFIG_BACKLIGHT_CORGI
/* If battery is low. limit backlight intensity to save power. */
if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
&& ((sharpsl_pm.battstat.mainbat_status == APM_BATTERY_STATUS_LOW) ||
Expand All @@ -169,6 +170,7 @@ static void sharpsl_battery_thread(struct work_struct *private_)
sharpsl_pm.machinfo->backlight_limit(0);
sharpsl_pm.flags &= ~SHARPSL_BL_LIMIT;
}
#endif

/* Suspend if critical battery level */
if ((sharpsl_pm.battstat.ac_status != APM_AC_ONLINE)
Expand Down
25 changes: 0 additions & 25 deletions trunk/arch/arm/mach-pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ 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 @@ -118,7 +116,6 @@ 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 @@ -149,22 +146,6 @@ 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 @@ -292,10 +273,4 @@ 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: 0 additions & 1 deletion trunk/arch/arm/mach-pxa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-pxa/corgi_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = {
.read_devdata = corgipm_read_devdata,
.charger_wakeup = corgi_charger_wakeup,
.should_wakeup = corgi_should_wakeup,
#ifdef CONFIG_BACKLIGHT_CORGI
.backlight_limit = corgibl_limit_intensity,
#endif
.charge_on_volt = SHARPSL_CHARGE_ON_VOLT,
.charge_on_temp = SHARPSL_CHARGE_ON_TEMP,
.charge_acin_high = SHARPSL_CHARGE_ON_ACIN_HIGH,
Expand Down
60 changes: 0 additions & 60 deletions trunk/arch/arm/mach-pxa/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,36 +280,6 @@ 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 @@ -598,36 +568,6 @@ 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: 0 additions & 5 deletions trunk/arch/arm/mach-pxa/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@ 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);
38 changes: 21 additions & 17 deletions trunk/arch/arm/mach-pxa/lpd270.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#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 @@ -234,20 +233,21 @@ static struct platform_device lpd270_flash_device[2] = {
},
};

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,
},
};
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);
}
}

/* 5.7" TFT QVGA (LoLo display number 1) */
static struct pxafb_mode_info sharp_lq057q3dc02_mode = {
Expand All @@ -269,6 +269,7 @@ 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 @@ -291,6 +292,7 @@ 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 @@ -313,6 +315,7 @@ 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 @@ -335,6 +338,7 @@ 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 @@ -357,6 +361,7 @@ 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 @@ -379,6 +384,7 @@ 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 @@ -408,7 +414,6 @@ __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 @@ -449,7 +454,6 @@ 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
68 changes: 24 additions & 44 deletions trunk/arch/arm/mach-pxa/magician.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/mtd/map.h>
#include <linux/mtd/physmap.h>
#include <linux/pda_power.h>
#include <linux/pwm_backlight.h>

#include <asm/gpio.h>
#include <asm/hardware.h>
Expand All @@ -40,7 +39,6 @@
#include <asm/arch/irda.h>
#include <asm/arch/ohci.h>

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

static unsigned long magician_pin_config[] = {
Expand Down Expand Up @@ -350,58 +348,40 @@ static struct pxafb_mach_info samsung_info = {
* Backlight
*/

static int magician_backlight_init(struct device *dev)
static void magician_set_bl_intensity(int intensity)
{
int ret;

ret = gpio_request(EGPIO_MAGICIAN_BL_POWER, "BL_POWER");
if (ret)
goto err;
ret = gpio_request(EGPIO_MAGICIAN_BL_POWER2, "BL_POWER2");
if (ret)
goto err2;
return 0;

err2:
gpio_free(EGPIO_MAGICIAN_BL_POWER);
err:
return ret;
}

static int magician_backlight_notify(int brightness)
{
gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness);
if (brightness >= 200) {
gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 1);
return brightness - 72;
if (intensity) {
PWM_CTRL0 = 1;
PWM_PERVAL0 = 0xc8;
if (intensity > 0xc7) {
PWM_PWDUTY0 = intensity - 0x48;
gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 1);
} else {
PWM_PWDUTY0 = intensity;
gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 0);
}
gpio_set_value(EGPIO_MAGICIAN_BL_POWER, 1);
pxa_set_cken(CKEN_PWM0, 1);
} else {
gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 0);
return brightness;
/* PWM_PWDUTY0 = intensity; */
gpio_set_value(EGPIO_MAGICIAN_BL_POWER, 0);
pxa_set_cken(CKEN_PWM0, 0);
}
}

static void magician_backlight_exit(struct device *dev)
{
gpio_free(EGPIO_MAGICIAN_BL_POWER);
gpio_free(EGPIO_MAGICIAN_BL_POWER2);
}

static struct platform_pwm_backlight_data backlight_data = {
.pwm_id = 0,
.max_brightness = 272,
.dft_brightness = 100,
.pwm_period_ns = 30923,
.init = magician_backlight_init,
.notify = magician_backlight_notify,
.exit = magician_backlight_exit,
static struct generic_bl_info backlight_info = {
.default_intensity = 0x64,
.limit_mask = 0x0b,
.max_intensity = 0xc7+0x48,
.set_bl_intensity = magician_set_bl_intensity,
};

static struct platform_device backlight = {
.name = "pwm-backlight",
.name = "generic-bl",
.dev = {
.parent = &pxa27x_device_pwm0.dev,
.platform_data = &backlight_data,
.platform_data = &backlight_info,
},
.id = -1,
};

/*
Expand Down
Loading

0 comments on commit 5c9b0c1

Please sign in to comment.