コード例 #1
0
ファイル: 88pm860x_bl.c プロジェクト: 7799/linux
static int pm860x_backlight_dt_init(struct platform_device *pdev,
				    struct pm860x_backlight_data *data,
				    char *name)
{
	struct device_node *nproot, *np;
	int iset = 0;

	nproot = of_node_get(pdev->dev.parent->of_node);
	if (!nproot)
		return -ENODEV;
	nproot = of_find_node_by_name(nproot, "backlights");
	if (!nproot) {
		dev_err(&pdev->dev, "failed to find backlights node\n");
		return -ENODEV;
	}
	for_each_child_of_node(nproot, np) {
		if (!of_node_cmp(np->name, name)) {
			of_property_read_u32(np, "marvell,88pm860x-iset",
					     &iset);
			data->iset = PM8606_WLED_CURRENT(iset);
			of_property_read_u32(np, "marvell,88pm860x-pwm",
					     &data->pwm);
			break;
		}
	}
	of_node_put(nproot);
	return 0;
}
コード例 #2
0
#define SAARB_NR_IRQS	(IRQ_BOARD_START + 40)

static struct pm860x_touch_pdata saarb_touch = {
	.gpadc_prebias	= 1,
	.slot_cycle	= 1,
	.tsi_prebias	= 6,
	.pen_prebias	= 16,
	.pen_prechg	= 2,
	.res_x		= 300,
};

static struct pm860x_backlight_pdata saarb_backlight[] = {
	{
		.id	= PM8606_ID_BACKLIGHT,
		.iset	= PM8606_WLED_CURRENT(24),
		.flags	= PM8606_BACKLIGHT1,
	},
	{},
};

static struct pm860x_led_pdata saarb_led[] = {
	{
		.id	= PM8606_ID_LED,
		.iset	= PM8606_LED_CURRENT(12),
		.flags	= PM8606_LED1_RED,
	}, {
		.id	= PM8606_ID_LED,
		.iset	= PM8606_LED_CURRENT(12),
		.flags	= PM8606_LED1_GREEN,
	}, {
コード例 #3
0
static struct wake_lock wifi_delayed_work_wake_lock;
static struct wake_lock cd_wake_lock;


#if defined(CONFIG_TOUCHSCREEN_VNC)
static struct platform_device vnc_device = {
	.name	= "vnc-ts",
	.id	= -1,
};
#endif

static struct pm860x_backlight_pdata backlight[] = {
	{
	 /*backlight data */
	 .id = PM8606_ID_BACKLIGHT,
	 .iset = PM8606_WLED_CURRENT(0x12),
	 .flags = PM8606_BACKLIGHT1,
	 },
	{
	 /*keypad backlight data */
	 .id = PM8606_ID_BACKLIGHT,
	 .pwm = 0x10,
	 .iset = PM8606_WLED_CURRENT(0x05),
	 .flags = PM8606_BACKLIGHT2,
	 },
};

static struct pm860x_led_pdata led[] = {
	{
	 .id = PM8606_ID_LED,
	 .iset = PM8606_LED_CURRENT(12),