Beispiel #1
0
#include "intel_soc_pmic_core.h"

/* Lookup table for the Panel Enable/Disable line as GPIO signals */
static struct gpiod_lookup_table panel_gpio_table = {
	/* Intel GFX is consumer */
	.dev_id = "0000:00:02.0",
	.table = {
		/* Panel EN/DISABLE */
		GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH),
		{ },
	},
};

/* PWM consumed by the Intel GFX */
static struct pwm_lookup crc_pwm_lookup[] = {
	PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_backlight", 0, PWM_POLARITY_NORMAL),
};

static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
				    const struct i2c_device_id *i2c_id)
{
	struct device *dev = &i2c->dev;
	const struct acpi_device_id *id;
	struct intel_soc_pmic_config *config;
	struct intel_soc_pmic *pmic;
	int ret;

	id = acpi_match_device(dev->driver->acpi_match_table, dev);
	if (!id || !id->driver_data)
		return -ENODEV;
Beispiel #2
0
	if (ret)
		pr_err("failed to request gpio for LCD power: %d\n", ret);
}

static struct plat_lcd_data origen_lcd_hv070wsa_data = {
	.set_power = lcd_hv070wsa_set_power,
};

static struct platform_device origen_lcd_hv070wsa = {
	.name			= "platform-lcd",
	.dev.parent		= &s5p_device_fimd0.dev,
	.dev.platform_data	= &origen_lcd_hv070wsa_data,
};

static struct pwm_lookup origen_pwm_lookup[] = {
	PWM_LOOKUP("s3c24xx-pwm.0", 0, "pwm-backlight.0", NULL),
};

#ifdef CONFIG_DRM_EXYNOS_FIMD
static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
	.panel	= {
		.timing	= {
			.left_margin	= 64,
			.right_margin	= 16,
			.upper_margin	= 64,
			.lower_margin	= 16,
			.hsync_len	= 48,
			.vsync_len	= 3,
			.xres		= 1024,
			.yres		= 600,
		},
Beispiel #3
0
	.max_brightness = 200,
	.dft_brightness = 100,
	.pwm_period_ns  = 30923,
};

static struct platform_device backlight = {
	.name = "pwm-backlight",
	.id   = -1,
	.dev  = {
		.parent        = &pxa27x_device_pwm1.dev,
		.platform_data = &backlight_data,
	},
};

static struct pwm_lookup hx4700_pwm_lookup[] = {
	PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL),
};

/*
 * USB "Transceiver"
 */

static struct gpio_vbus_mach_info gpio_vbus_info = {
	.gpio_pullup        = GPIO76_HX4700_USBC_PUEN,
	.gpio_vbus          = GPIOD14_nUSBC_DETECT,
	.gpio_vbus_inverted = 1,
};

static struct platform_device gpio_vbus = {
	.name          = "gpio-vbus",
	.id            = -1,
Beispiel #4
0
		.polarity = PWM_POLARITY_INVERSED,
	}
};

static struct platform_device pwm_device = {
	.name = "renesas-tpu-pwm",
	.id = -1,
	.dev = {
		.platform_data = &pwm_device_data,
	},
	.num_resources = ARRAY_SIZE(pwm_resources),
	.resource = pwm_resources,
};

static struct pwm_lookup pwm_lookup[] = {
	PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL),
};

/* LCDC and backlight */
static struct platform_pwm_backlight_data pwm_backlight_data = {
	.lth_brightness = 50,
	.max_brightness = 255,
	.dft_brightness = 255,
	.pwm_period_ns = 33333, /* 30kHz */
};

static struct platform_device pwm_backlight_device = {
	.name = "pwm-backlight",
	.dev = {
		.platform_data = &pwm_backlight_data,
	},
Beispiel #5
0
		.flags	     = 0,
		.ucon	     = UCON,
		.ulcon	     = ULCON,
		.ufcon	     = UFCON,
	},
	[2] = {
		.hwport	     = 2,
		.flags	     = 0,
		.ucon	     = UCON,
		.ulcon	     = ULCON,
		.ufcon	     = UFCON,
	},
};

static struct pwm_lookup hmt_pwm_lookup[] = {
	PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL,
		   1000000000 / (100 * 256 * 20), PWM_POLARITY_NORMAL),
};

static int hmt_bl_init(struct device *dev)
{
	int ret;

	ret = gpio_request(S3C64XX_GPB(4), "lcd backlight enable");
	if (!ret)
		ret = gpio_direction_output(S3C64XX_GPB(4), 0);

	return ret;
}

static int hmt_bl_notify(struct device *dev, int brightness)
{
	.startup_delay		= 70000, /* 70msec */
	.enable_high		= 1,
	.enabled_at_boot	= 0,
	.init_data		= &zoom_vmmc3,
};

static struct platform_device omap_vwlan_device = {
	.name		= "reg-fixed-voltage",
	.id		= 1,
	.dev = {
		.platform_data	= &zoom_vwlan,
	},
};

static struct pwm_lookup zoom_pwm_lookup[] = {
	PWM_LOOKUP("twl-pwm", 0, "leds_pwm", "zoom::keypad"),
	PWM_LOOKUP("twl-pwm", 1, "pwm-backlight", "backlight"),
};

static struct led_pwm zoom_pwm_leds[] = {
	{
		.name		= "zoom::keypad",
		.max_brightness	= 127,
		.pwm_period_ns	= 7812500,
	},
};

static struct led_pwm_platform_data zoom_pwm_data = {
	.num_leds	= ARRAY_SIZE(zoom_pwm_leds),
	.leds		= zoom_pwm_leds,
};
#include "common.h"
#include "omap_device.h"
#include "gpmc.h"
#include "soc.h"
#include "mux.h"
#include "hsmmc.h"
#include "pm.h"
#include "board-flash.h"
#include "common-board-devices.h"

#define	NAND_CS	0

static struct pwm_lookup pwm_lookup[] = {
	/* LEDB -> PMU_STAT */
	PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat",
		   7812500, PWM_POLARITY_NORMAL),
};

static struct led_pwm pwm_leds[] = {
	{
		.name		= "beagleboard::pmu_stat",
		.max_brightness	= 127,
		.pwm_period_ns	= 7812500,
	},
};

static struct led_pwm_platform_data pwm_data = {
	.num_leds	= ARRAY_SIZE(pwm_leds),
	.leds		= pwm_leds,
};
Beispiel #8
0
#include "common.h"
#include "omap_device.h"
#include "gpmc.h"
#include "soc.h"
#include "mux.h"
#include "hsmmc.h"
#include "pm.h"
#include "board-flash.h"
#include "common-board-devices.h"

#define	NAND_CS	0

static struct pwm_lookup pwm_lookup[] = {
	/* LEDB -> PMU_STAT */
	PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"),
};

static struct led_pwm pwm_leds[] = {
	{
		.name		= "beagleboard::pmu_stat",
		.max_brightness	= 127,
		.pwm_period_ns	= 7812500,
	},
};

static struct led_pwm_platform_data pwm_data = {
	.num_leds	= ARRAY_SIZE(pwm_leds),
	.leds		= pwm_leds,
};
Beispiel #9
0
				"W1 external pullup enable");

	if (ret < 0)
		pr_warn("Unable to request GPIO_W1_PULLUP_ENABLE\n");
	else
		gpio_direction_output(GPIO_W1_PULLUP_ENABLE, 0);

	platform_device_register(&raumfeld_w1_gpio_device);
}

/**
 * Framebuffer device
 */

static struct pwm_lookup raumfeld_pwm_lookup[] = {
	PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight", NULL, 10000,
		   PWM_POLARITY_NORMAL),
};

/* PWM controlled backlight */
static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
	.max_brightness	= 100,
	.dft_brightness	= 100,
	.enable_gpio	= -1,
};

static struct platform_device raumfeld_pwm_backlight_device = {
	.name	= "pwm-backlight",
	.dev	= {
		.parent		= &pxa27x_device_pwm0.dev,
		.platform_data	= &raumfeld_pwm_backlight_data,
	}
Beispiel #10
0
	} else {
		palm27x_batt_pdata.min_voltage	= minv,
		palm27x_batt_pdata.max_voltage	= maxv,

		pxa_set_ac97_info(&palm27x_ac97_pdata);
		platform_device_register(&palm27x_asoc);
	}
}
#endif

/******************************************************************************
 * Backlight
 ******************************************************************************/
#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
static struct pwm_lookup palm27x_pwm_lookup[] = {
	PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 3500 * 1024,
		   PWM_POLARITY_NORMAL),
};

static int palm_bl_power;
static int palm_lcd_power;

static int palm27x_backlight_init(struct device *dev)
{
	int ret;

	ret = gpio_request(palm_bl_power, "BL POWER");
	if (ret)
		goto err;
	ret = gpio_direction_output(palm_bl_power, 0);
	if (ret)
		goto err2;
Beispiel #11
0
#if defined(CONFIG_USB_JZ_DWC2) || defined(CONFIG_USB_DWC_OTG)
#if defined(GPIO_USB_ID) && defined(GPIO_USB_ID_LEVEL)
struct jzdwc_pin dwc2_id_pin = {
	.num = GPIO_USB_ID,
	.enable_level = GPIO_USB_ID_LEVEL,
};
#endif

#if defined(GPIO_USB_DETE) && defined(GPIO_USB_DETE_LEVEL)
struct jzdwc_pin dwc2_dete_pin = {
	.num = GPIO_USB_DETE,
	.enable_level = GPIO_USB_DETE_LEVEL,
};
#endif

#if defined(GPIO_USB_DRVVBUS) && defined(GPIO_USB_DRVVBUS_LEVEL) && !defined(USB_DWC2_DRVVBUS_FUNCTION_PIN)
struct jzdwc_pin dwc2_drvvbus_pin = {
	.num = GPIO_USB_DRVVBUS,
	.enable_level = GPIO_USB_DRVVBUS_LEVEL,
};
#endif
#endif /*CONFIG_USB_JZ_DWC2 || CONFIG_USB_DWC_OTG*/

#ifdef CONFIG_PWM_SDK
struct pwm_lookup jz_pwm_lookup[] = {
	PWM_LOOKUP("jz-pwm", 2, "pwm-sdk", "pwm-sdk.2"),
	PWM_LOOKUP("jz-pwm", 3, "pwm-sdk", "pwm-sdk.3"),
};
int jz_pwm_lookup_size = ARRAY_SIZE(jz_pwm_lookup);
#endif
					   parameter defined by pwm_lookup */
#elif defined(CONFIG_FB_MODE_DI_7W)
	.pwm_period_ns	= 50*1000,	/* 20kHz: This setting overrides the
					   parameter defined by pwm_lookup */
#endif
	.enable_gpio	= -1,
};

/* Fixed 5.0V regulator used by LCD backlight */
static struct regulator_consumer_supply fixed5v0_power_consumers[] = {
	REGULATOR_SUPPLY("power", "pwm-backlight"),
};

static struct pwm_lookup armadillo4x0_pwm_lookup[] = {
#if defined(CONFIG_FB_MODE_FG040360DSSWBG03)
	PWM_LOOKUP("imx27-pwm.0", 0, "pwm-backlight", NULL,
		   10*1000*1000, PWM_POLARITY_INVERSED),
#elif defined(CONFIG_FB_MODE_DI_7W)
	PWM_LOOKUP("imx27-pwm.0", 0, "pwm-backlight", NULL,
		   50*1000, PWM_POLARITY_NORMAL),
#endif
};

static void __init armadillo4x0_lcd_init(void)
{
	if (IS_ENABLED(CONFIG_MXC_PWM_SELECT1)) {
		imx25_add_mxc_pwm(0);

		pwm_add_table(armadillo4x0_pwm_lookup,
			      ARRAY_SIZE(armadillo4x0_pwm_lookup));

		regulator_register_always_on(4, "fixed-5.0V",
Beispiel #13
0
	.reset_pin		= PIN_AC97_RST_N,
};
#endif

#ifdef CONFIG_BOARD_MRMT_UCB1400_TS
/* NOTE: IRQ assignment relies on kernel module parameter */
static struct platform_device rmt_ts_device = {
	.name	= "ucb1400_ts",
	.id	= -1,
};
#endif

#ifdef CONFIG_BOARD_MRMT_BL_PWM
/* PWM LEDs: LCD Backlight, etc */
static struct pwm_lookup pwm_lookup[] = {
	PWM_LOOKUP("at91sam9rl-pwm", PWM_CH_BL, "leds_pwm", "ds1",
		   5000, PWM_POLARITY_INVERSED),
};

static struct led_pwm pwm_leds[] = {
	{
		.name = "backlight",
		.max_brightness = 255,
	},
};

static struct led_pwm_platform_data pwm_data = {
	.num_leds       = ARRAY_SIZE(pwm_leds),
	.leds           = pwm_leds,
};

static struct platform_device leds_pwm = {