aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/intel-mid/device_libs/platform_tc35876x.c
blob: 139738bbdd36e50ef660ae247aceb2c7a897b904 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: GPL-2.0-only
/*
 * platform_tc35876x.c: tc35876x platform data initialization file
 *
 * (C) Copyright 2013 Intel Corporation
 * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
 */

#include <linux/gpio/machine.h>
#include <asm/intel-mid.h>

static struct gpiod_lookup_table tc35876x_gpio_table = {
	.dev_id	= "i2c_disp_brig",
	.table	= {
		GPIO_LOOKUP("0000:00:0c.0", -1, "bridge-reset", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("0000:00:0c.0", -1, "bl-en", GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP("0000:00:0c.0", -1, "vadd", GPIO_ACTIVE_HIGH),
		{ },
	},
};

/*tc35876x DSI_LVDS bridge chip and panel platform data*/
static void *tc35876x_platform_data(void *data)
{
	struct gpiod_lookup_table *table = &tc35876x_gpio_table;
	struct gpiod_lookup *lookup = table->table;

	lookup[0].chip_hwnum = get_gpio_by_name("LCMB_RXEN");
	lookup[1].chip_hwnum = get_gpio_by_name("6S6P_BL_EN");
	lookup[2].chip_hwnum = get_gpio_by_name("EN_VREG_LCD_V3P3");
	gpiod_add_lookup_table(table);

	return NULL;
}

static const struct devs_id tc35876x_dev_id __initconst = {
	.name = "i2c_disp_brig",
	.type = SFI_DEV_TYPE_I2C,
	.get_platform_data = &tc35876x_platform_data,
};

sfi_device(tc35876x_dev_id);