All pastes #79767 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-07-05 17:57 UTC
rendered paste body
static struct pxapwmbl_platform_data palmz31_backlight_data = {
	.pwm			=	0,      //need to find values from the developer's manual.
	.max_intensity		=	0x160, //same story.
	.default_intensity	=	0x11a, // la la laaaa.
	.limit_mask		=	0x7f,  //Svidrigailoff was an asshole.
	.prescaler		=	7,     //I blame his parents.
	.period			=	0x16c, //he had a horrible upbringing.
};

static struct platform_device palmz31_backlight = {
	.name	=	"pxapwm-bl",
	.dev	=	{
		.platform_data	=	&palmz31_backlight_data,
	},
};

static void palm_backlight_power(int on){
	//this is described as "TO DO" ... I'll have to do more reading.
	if(on){
		// Set up backlight PWM settings (taken from palmte2.c)
		PWM_CTRL0	=	0x7;
		PWM_PWDUTY0	=	palmz31_backlight_data.default_intensity;
		PWM_PERVAL0	=	palmz31_backlight_data.period;
		// turn on PWMs
		CKEN |= CKEN0_PWM0 | CKEN1_PWM1;
	} else {