Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
402e4909
Commit
402e4909
authored
Apr 13, 2008
by
Russell King
Committed by
Russell King
Jul 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] pxa: make mainstone use the generic PWM backlight driver
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
5cca9147
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
46 deletions
+18
-46
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Kconfig
+1
-0
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mainstone.c
+17
-46
No files found.
arch/arm/mach-pxa/Kconfig
View file @
402e4909
...
@@ -41,6 +41,7 @@ config MACH_LOGICPD_PXA270
...
@@ -41,6 +41,7 @@ config MACH_LOGICPD_PXA270
config MACH_MAINSTONE
config MACH_MAINSTONE
bool "Intel HCDDBBVA0 Development Platform"
bool "Intel HCDDBBVA0 Development Platform"
select PXA27x
select PXA27x
select HAVE_PWM
config ARCH_PXA_IDP
config ARCH_PXA_IDP
bool "Accelent Xscale IDP"
bool "Accelent Xscale IDP"
...
...
arch/arm/mach-pxa/mainstone.c
View file @
402e4909
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
#include <linux/ioport.h>
#include <linux/ioport.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/partitions.h>
#include <linux/backlight.h>
#include <linux/input.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/gpio_keys.h>
#include <linux/pwm_backlight.h>
#include <asm/types.h>
#include <asm/types.h>
#include <asm/setup.h>
#include <asm/setup.h>
...
@@ -349,56 +349,27 @@ static struct platform_device mst_flash_device[2] = {
...
@@ -349,56 +349,27 @@ static struct platform_device mst_flash_device[2] = {
},
},
};
};
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
static
int
mainstone_backlight_update_status
(
struct
backlight_device
*
bl
)
static
struct
platform_pwm_backlight_data
mainstone_backlight_data
=
{
{
.
pwm_id
=
0
,
int
brightness
=
bl
->
props
.
brightness
;
.
max_brightness
=
1023
,
.
dft_brightness
=
1023
,
if
(
bl
->
props
.
power
!=
FB_BLANK_UNBLANK
||
.
pwm_period_ns
=
78770
,
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
;
}
static
/*const*/
struct
backlight_ops
mainstone_backlight_ops
=
{
static
struct
platform_device
mainstone_backlight_device
=
{
.
update_status
=
mainstone_backlight_update_status
,
.
name
=
"pwm-backlight"
,
.
get_brightness
=
mainstone_backlight_get_brightness
,
.
dev
=
{
.
parent
=
&
pxa27x_device_pwm0
.
dev
,
.
platform_data
=
&
mainstone_backlight_data
,
},
};
};
static
void
__init
mainstone_backlight_register
(
void
)
static
void
__init
mainstone_backlight_register
(
void
)
{
{
struct
backlight_device
*
bl
;
int
ret
=
platform_device_register
(
&
mainstone_backlight_device
);
if
(
ret
)
bl
=
backlight_device_register
(
"mainstone-bl"
,
&
pxa_device_fb
.
dev
,
printk
(
KERN_ERR
"mainstone: failed to register backlight device: %d
\n
"
,
ret
);
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
);
}
}
#else
#else
#define mainstone_backlight_register() do { } while (0)
#define mainstone_backlight_register() do { } while (0)
...
...
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