Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
OpenBMC Firmware
talos-obmc-linux
Commits
fdc614e8
Commit
fdc614e8
authored
16 years ago
by
Russell King
Committed by
Russell King
16 years ago
Browse files
Options
Download
Plain Diff
Merge branches 'pxa-misc', 'pxa-pwm' and 'pxa-multi' into pxa
parents
bdb08cb2
c0f7edb3
9fc697b0
Changes
49
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
925 additions
and
1660 deletions
+925
-1660
arch/arm/Kconfig
arch/arm/Kconfig
+3
-0
arch/arm/common/sharpsl_pm.c
arch/arm/common/sharpsl_pm.c
+3
-0
arch/arm/configs/em_x270_defconfig
arch/arm/configs/em_x270_defconfig
+0
-1265
arch/arm/configs/xm_x270_defconfig
arch/arm/configs/xm_x270_defconfig
+597
-265
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Kconfig
+37
-22
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/Makefile
+1
-0
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.c
+1
-1
arch/arm/mach-pxa/cm-x270-pci.c
arch/arm/mach-pxa/cm-x270-pci.c
+14
-12
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/corgi.c
+1
-0
arch/arm/mach-pxa/corgi_pm.c
arch/arm/mach-pxa/corgi_pm.c
+7
-0
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/devices.c
+69
-0
arch/arm/mach-pxa/devices.h
arch/arm/mach-pxa/devices.h
+5
-0
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/em-x270.c
+1
-0
arch/arm/mach-pxa/generic.c
arch/arm/mach-pxa/generic.c
+1
-0
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lpd270.c
+23
-24
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/magician.c
+45
-24
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mainstone.c
+17
-46
arch/arm/mach-pxa/mfp-pxa2xx.c
arch/arm/mach-pxa/mfp-pxa2xx.c
+1
-0
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/pcm990-baseboard.c
+98
-1
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/poodle.c
+1
-0
No files found.
arch/arm/Kconfig
View file @
fdc614e8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
arch/arm/common/sharpsl_pm.c
View file @
fdc614e8
...
...
@@ -31,6 +31,7 @@
#include <asm/irq.h>
#include <asm/arch/pm.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/sharpsl.h>
#include <asm/hardware/sharpsl_pm.h>
...
...
@@ -157,6 +158,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
)
||
...
...
@@ -169,6 +171,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
)
...
...
This diff is collapsed.
Click to expand it.
arch/arm/configs/em_x270_defconfig
deleted
100644 → 0
View file @
bdb08cb2
This diff is collapsed.
Click to expand it.
arch/arm/configs/
c
m_x270_defconfig
→
arch/arm/configs/
x
m_x270_defconfig
View file @
fdc614e8
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/Kconfig
View file @
fdc614e8
...
...
@@ -20,8 +20,7 @@ endmenu
endif
choice
prompt "Select target board"
menu "Select target boards"
config ARCH_GUMSTIX
bool "Gumstix XScale boards"
...
...
@@ -37,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"
...
...
@@ -116,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)"
...
...
@@ -138,7 +140,7 @@ config MACH_PCM027
select PXA27x
select IWMMXT
end
choice
end
menu
choice
prompt "Used baseboard"
...
...
@@ -146,25 +148,24 @@ choice
config MACH_PCM990_BASEBOARD
bool "PHYTEC PCM-990 development board"
select HAVE_PWM
endchoice
if PXA_SHARPSL
choice
prompt "Select target Sharp Zaurus device range"
prompt "display on pcm990"
depends on MACH_PCM990_BASEBOARD
config PXA_SHARPSL_25x
bool "Sharp PXA25x models (SL-5600, SL-C7xx and SL-C6000x)"
select PXA25x
config PCM990_DISPLAY_SHARP
bool "sharp lq084v1dg21 stn display"
config PXA_SHARPSL_27x
bool "Sharp PXA270 models (SL-Cxx00)"
select PXA27x
config PCM990_DISPLAY_NEC
bool "nec nl6448bc20_18d tft display"
endchoice
config PCM990_DISPLAY_NONE
bool "no display"
end
if
end
choice
if ARCH_GUMSTIX
...
...
@@ -199,28 +200,33 @@ endmenu
config MACH_POODLE
bool "Enable Sharp SL-5600 (Poodle) Support"
depends on PXA_SHARPSL_25x
depends on PXA_SHARPSL
select PXA25x
select SHARP_LOCOMO
select PXA_SSP
config MACH_CORGI
bool "Enable Sharp SL-C700 (Corgi) Support"
depends on PXA_SHARPSL_25x
depends on PXA_SHARPSL
select PXA25x
select PXA_SHARP_C7xx
config MACH_SHEPHERD
bool "Enable Sharp SL-C750 (Shepherd) Support"
depends on PXA_SHARPSL_25x
depends on PXA_SHARPSL
select PXA25x
select PXA_SHARP_C7xx
config MACH_HUSKY
bool "Enable Sharp SL-C760 (Husky) Support"
depends on PXA_SHARPSL_25x
depends on PXA_SHARPSL
select PXA25x
select PXA_SHARP_C7xx
config MACH_AKITA
bool "Enable Sharp SL-1000 (Akita) Support"
depends on PXA_SHARPSL_27x
depends on PXA_SHARPSL
select PXA27x
select PXA_SHARP_Cxx00
select MACH_SPITZ
select I2C
...
...
@@ -228,17 +234,20 @@ config MACH_AKITA
config MACH_SPITZ
bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
depends on PXA_SHARPSL_27x
depends on PXA_SHARPSL
select PXA27x
select PXA_SHARP_Cxx00
config MACH_BORZOI
bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support"
depends on PXA_SHARPSL_27x
depends on PXA_SHARPSL
select PXA27x
select PXA_SHARP_Cxx00
config MACH_TOSA
bool "Enable Sharp SL-6000x (Tosa) Support"
depends on PXA_SHARPSL_25x
depends on PXA_SHARPSL
select PXA25x
config PXA25x
bool
...
...
@@ -273,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
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/Makefile
View file @
fdc614e8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/clock.c
View file @
fdc614e8
...
...
@@ -12,7 +12,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa
2xx
-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/hardware.h>
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/cm-x270-pci.c
View file @
fdc614e8
...
...
@@ -41,18 +41,20 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
{
unsigned
int
sz
=
SZ_64M
>>
PAGE_SHIFT
;
pr_info
(
"Adjusting zones for CM-x270
\n
"
);
/*
* Only adjust if > 64M on current system
*/
if
(
node
||
(
zone_size
[
0
]
<=
sz
))
return
;
zone_size
[
1
]
=
zone_size
[
0
]
-
sz
;
zone_size
[
0
]
=
sz
;
zhole_size
[
1
]
=
zhole_size
[
0
];
zhole_size
[
0
]
=
0
;
if
(
machine_is_armcore
())
{
pr_info
(
"Adjusting zones for CM-x270
\n
"
);
/*
* Only adjust if > 64M on current system
*/
if
(
node
||
(
zone_size
[
0
]
<=
sz
))
return
;
zone_size
[
1
]
=
zone_size
[
0
]
-
sz
;
zone_size
[
0
]
=
sz
;
zhole_size
[
1
]
=
zhole_size
[
0
];
zhole_size
[
0
]
=
0
;
}
}
static
void
cmx270_it8152_irq_demux
(
unsigned
int
irq
,
struct
irq_desc
*
desc
)
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/corgi.c
View file @
fdc614e8
...
...
@@ -36,6 +36,7 @@
#include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/arch/irda.h>
#include <asm/arch/mmc.h>
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/corgi_pm.c
View file @
fdc614e8
...
...
@@ -26,6 +26,7 @@
#include <asm/arch/sharpsl.h>
#include <asm/arch/corgi.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include "sharpsl.h"
...
...
@@ -204,7 +205,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
,
...
...
@@ -226,6 +229,10 @@ static int __devinit corgipm_init(void)
{
int
ret
;
if
(
!
machine_is_corgi
()
&&
!
machine_is_shepherd
()
&&
!
machine_is_husky
())
return
-
ENODEV
;
corgipm_device
=
platform_device_alloc
(
"sharpsl-pm"
,
-
1
);
if
(
!
corgipm_device
)
return
-
ENOMEM
;
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/devices.c
View file @
fdc614e8
...
...
@@ -10,11 +10,13 @@
#include <asm/arch/mmc.h>
#include <asm/arch/irda.h>
#include <asm/arch/i2c.h>
#include <asm/arch/mfp-pxa27x.h>
#include <asm/arch/ohci.h>
#include <asm/arch/pxa27x_keypad.h>
#include <asm/arch/camera.h>
#include "devices.h"
#include "generic.h"
void
__init
pxa_register_device
(
struct
platform_device
*
dev
,
void
*
data
)
{
...
...
@@ -233,8 +235,15 @@ struct platform_device pxa_device_i2c = {
.
num_resources
=
ARRAY_SIZE
(
pxai2c_resources
),
};
static
unsigned
long
pxa27x_i2c_mfp_cfg
[]
=
{
GPIO117_I2C_SCL
,
GPIO118_I2C_SDA
,
};
void
__init
pxa_set_i2c_info
(
struct
i2c_pxa_platform_data
*
info
)
{
if
(
cpu_is_pxa27x
())
pxa2xx_mfp_config
(
ARRAY_AND_SIZE
(
pxa27x_i2c_mfp_cfg
));
pxa_register_device
(
&
pxa_device_i2c
,
info
);
}
...
...
@@ -280,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
[]
=
{
...
...
@@ -568,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
,
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/devices.h
View file @
fdc614e8
...
...
@@ -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
);
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/em-x270.c
View file @
fdc614e8
...
...
@@ -24,6 +24,7 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/arch/pxa27x-udc.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/ohci.h>
#include <asm/arch/mmc.h>
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/generic.c
View file @
fdc614e8
...
...
@@ -26,6 +26,7 @@
#include <asm/mach/map.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
/* for __pxa_set_cken */
#include "generic.h"
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/lpd270.c
View file @
fdc614e8
...
...
@@ -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>
...
...
@@ -134,9 +135,12 @@ static struct sys_device lpd270_irq_device = {
static
int
__init
lpd270_irq_device_init
(
void
)
{
int
ret
=
sysdev_class_register
(
&
lpd270_irq_sysclass
);
if
(
ret
==
0
)
ret
=
sysdev_register
(
&
lpd270_irq_device
);
int
ret
=
-
ENODEV
;
if
(
machine_is_logicpd_pxa270
())
{
ret
=
sysdev_class_register
(
&
lpd270_irq_sysclass
);
if
(
ret
==
0
)
ret
=
sysdev_register
(
&
lpd270_irq_device
);
}
return
ret
;
}
...
...
@@ -233,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
=
{
...
...
@@ -269,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) */
...
...
@@ -292,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) */
...
...
@@ -315,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) */
...
...
@@ -338,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) */
...
...
@@ -361,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) */
...
...
@@ -384,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
;
...
...
@@ -414,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
],
...
...
@@ -454,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
));
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/magician.c
View file @
fdc614e8
...
...
@@ -25,6 +25,7 @@
#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>
...
...
@@ -33,12 +34,14 @@
#include <asm/arch/magician.h>
#include <asm/arch/mfp-pxa27x.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/i2c.h>
#include <asm/arch/mmc.h>
#include <asm/arch/irda.h>
#include <asm/arch/ohci.h>
#include "devices.h"
#include "generic.h"
static
unsigned
long
magician_pin_config
[]
=
{
...
...
@@ -348,40 +351,58 @@ static struct pxafb_mach_info samsung_info = {
* Backlight
*/
static
void
magician_
set_bl_intensity
(
int
intensity
)
static
int
magician_
backlight_init
(
struct
device
*
dev
)
{
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
);
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
;
}
else
{
/* PWM_PWDUTY0 = intensity; */
gpio_set_value
(
EGPIO_MAGICIAN_BL_POWER
,
0
);
pxa_set_cken
(
CKEN_PWM0
,
0
);
gpio_set_value
(
EGPIO_MAGICIAN_BL_POWER2
,
0
);
return
brightness
;
}
}
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
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
platform_device
backlight
=
{
.
name
=
"
generic-bl
"
,
.
name
=
"
pwm-backlight
"
,
.
dev
=
{
.
platform_data
=
&
backlight_info
,
.
parent
=
&
pxa27x_device_pwm0
.
dev
,
.
platform_data
=
&
backlight_data
,
},
.
id
=
-
1
,
};
/*
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/mainstone.c
View file @
fdc614e8
...
...
@@ -23,9 +23,9 @@
#include <linux/ioport.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/backlight.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/pwm_backlight.h>
#include <asm/types.h>
#include <asm/setup.h>
...
...
@@ -349,56 +349,27 @@ static struct platform_device mst_flash_device[2] = {
},
};
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
static
int
mainstone_backlight_update_status
(
struct
backlight_device
*
bl
)
{
int
brightness
=
bl
->
props
.
brightness
;
if
(
bl
->
props
.
power
!=
FB_BLANK_UNBLANK
||
bl
->
props
.
fb_blank
!=
FB_BLANK_UNBLANK
)
brightness
=
0
;
if
(
brightness
!=
0
)
pxa_set_cken
(
CKEN_PWM0
,
1
);
PWM_CTRL0
=
0
;
PWM_PWDUTY0
=
brightness
;
PWM_PERVAL0
=
bl
->
props
.
max_brightness
;
if
(
brightness
==
0
)
pxa_set_cken
(
CKEN_PWM0
,
0
);
return
0
;
/* pointless return value */
}
static
int
mainstone_backlight_get_brightness
(
struct
backlight_device
*
bl
)
{
return
PWM_PWDUTY0
;
}
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static
struct
platform_pwm_backlight_data
mainstone_backlight_data
=
{
.
pwm_id
=
0
,
.
max_brightness
=
1023
,
.
dft_brightness
=
1023
,
.
pwm_period_ns
=
78770
,
};
static
/*const*/
struct
backlight_ops
mainstone_backlight_ops
=
{
.
update_status
=
mainstone_backlight_update_status
,
.
get_brightness
=
mainstone_backlight_get_brightness
,
static
struct
platform_device
mainstone_backlight_device
=
{
.
name
=
"pwm-backlight"
,
.
dev
=
{
.
parent
=
&
pxa27x_device_pwm0
.
dev
,
.
platform_data
=
&
mainstone_backlight_data
,
},
};
static
void
__init
mainstone_backlight_register
(
void
)
{
struct
backlight_device
*
bl
;
bl
=
backlight_device_register
(
"mainstone-bl"
,
&
pxa_device_fb
.
dev
,
NULL
,
&
mainstone_backlight_ops
);
if
(
IS_ERR
(
bl
))
{
printk
(
KERN_ERR
"mainstone: unable to register backlight: %ld
\n
"
,
PTR_ERR
(
bl
));
return
;
}
/*
* broken design - register-then-setup interfaces are
* utterly broken by definition.
*/
bl
->
props
.
max_brightness
=
1023
;
bl
->
props
.
brightness
=
1023
;
backlight_update_status
(
bl
);
int
ret
=
platform_device_register
(
&
mainstone_backlight_device
);
if
(
ret
)
printk
(
KERN_ERR
"mainstone: failed to register backlight device: %d
\n
"
,
ret
);
}
#else
#define mainstone_backlight_register() do { } while (0)
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/mfp-pxa2xx.c
View file @
fdc614e8
...
...
@@ -20,6 +20,7 @@
#include <asm/arch/hardware.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/mfp-pxa2xx.h>
#include "generic.h"
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/pcm990-baseboard.c
View file @
fdc614e8
...
...
@@ -24,6 +24,7 @@
#include <linux/platform_device.h>
#include <linux/ide.h>
#include <linux/i2c.h>
#include <linux/pwm_backlight.h>
#include <media/soc_camera.h>
...
...
@@ -36,9 +37,99 @@
#include <asm/arch/mmc.h>
#include <asm/arch/ohci.h>
#include <asm/arch/pcm990_baseboard.h>
#include <asm/arch/pxafb.h>
#include "devices.h"
/*
* pcm990_lcd_power - control power supply to the LCD
* @on: 0 = switch off, 1 = switch on
*
* Called by the pxafb driver
*/
#ifndef CONFIG_PCM990_DISPLAY_NONE
static
void
pcm990_lcd_power
(
int
on
,
struct
fb_var_screeninfo
*
var
)
{
if
(
on
)
{
/* enable LCD-Latches
* power on LCD
*/
__PCM990_CTRL_REG
(
PCM990_CTRL_PHYS
+
PCM990_CTRL_REG3
)
=
PCM990_CTRL_LCDPWR
+
PCM990_CTRL_LCDON
;
}
else
{
/* disable LCD-Latches
* power off LCD
*/
__PCM990_CTRL_REG
(
PCM990_CTRL_PHYS
+
PCM990_CTRL_REG3
)
=
0x00
;
}
}
#endif
#if defined(CONFIG_PCM990_DISPLAY_SHARP)
static
struct
pxafb_mode_info
fb_info_sharp_lq084v1dg21
=
{
.
pixclock
=
28000
,
.
xres
=
640
,
.
yres
=
480
,
.
bpp
=
16
,
.
hsync_len
=
20
,
.
left_margin
=
103
,
.
right_margin
=
47
,
.
vsync_len
=
6
,
.
upper_margin
=
28
,
.
lower_margin
=
5
,
.
sync
=
0
,
.
cmap_greyscale
=
0
,
};
static
struct
pxafb_mach_info
pcm990_fbinfo
__initdata
=
{
.
modes
=
&
fb_info_sharp_lq084v1dg21
,
.
num_modes
=
1
,
.
lccr0
=
LCCR0_PAS
,
.
lccr3
=
LCCR3_PCP
,
.
pxafb_lcd_power
=
pcm990_lcd_power
,
};
#elif defined(CONFIG_PCM990_DISPLAY_NEC)
struct
pxafb_mode_info
fb_info_nec_nl6448bc20_18d
=
{
.
pixclock
=
39720
,
.
xres
=
640
,
.
yres
=
480
,
.
bpp
=
16
,
.
hsync_len
=
32
,
.
left_margin
=
16
,
.
right_margin
=
48
,
.
vsync_len
=
2
,
.
upper_margin
=
12
,
.
lower_margin
=
17
,
.
sync
=
0
,
.
cmap_greyscale
=
0
,
};
static
struct
pxafb_mach_info
pcm990_fbinfo
__initdata
=
{
.
modes
=
&
fb_info_nec_nl6448bc20_18d
,
.
num_modes
=
1
,
.
lccr0
=
LCCR0_Act
,
.
lccr3
=
LCCR3_PixFlEdg
,
.
pxafb_lcd_power
=
pcm990_lcd_power
,
};
#endif
static
struct
platform_pwm_backlight_data
pcm990_backlight_data
=
{
.
pwm_id
=
0
,
.
max_brightness
=
1023
,
.
dft_brightness
=
1023
,
.
pwm_period_ns
=
78770
,
};
static
struct
platform_device
pcm990_backlight_device
=
{
.
name
=
"pwm-backlight"
,
.
dev
=
{
.
parent
=
&
pxa27x_device_pwm0
.
dev
,
.
platform_data
=
&
pcm990_backlight_data
,
},
};
/*
* The PCM-990 development baseboard uses PCM-027's hard
e
ware in the
* The PCM-990 development baseboard uses PCM-027's hardware in the
* following way:
*
* - LCD support is in use
...
...
@@ -393,6 +484,12 @@ void __init pcm990_baseboard_init(void)
/* register CPLD's IRQ controller */
pcm990_init_irq
();
#ifndef CONFIG_PCM990_DISPLAY_NONE
set_pxa_fb_info
(
&
pcm990_fbinfo
);
#endif
pxa_gpio_mode
(
GPIO16_PWM0_MD
);
platform_device_register
(
&
pcm990_backlight_device
);
platform_device_register
(
&
pxa27x_device_ac97
);
/* MMC */
...
...
This diff is collapsed.
Click to expand it.
arch/arm/mach-pxa/poodle.c
View file @
fdc614e8
...
...
@@ -32,6 +32,7 @@
#include <asm/mach/irq.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/arch/mmc.h>
#include <asm/arch/udc.h>
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment