Example #1
0
static int add_children(struct i2c_client *client)
{
    static const struct {
        int offset;
        char *label;
    } config_inputs[] = {

        { 8 + 0, "sw6_1", },
        { 8 + 1, "sw6_2", },
        { 8 + 2, "sw6_3", },
        { 8 + 3, "sw6_4", },
        { 8 + 4, "NTSC/nPAL", },
    };

    struct device	*child;
    int		status;
    int		i;


    dm355evm_msp_gpio.dev = &client->dev;
    status = gpiochip_add(&dm355evm_msp_gpio);
    if (status < 0)
        return status;


    if (msp_has_leds()) {
#define GPIO_LED(l)	.name = l, .active_low = true
        static struct gpio_led evm_leds[] = {
            {   GPIO_LED("dm355evm::ds14"),
                .default_trigger = "heartbeat",
            },
            {   GPIO_LED("dm355evm::ds15"),
Example #2
0
File: main.c Project: coocox/Mplib
int main()
{
    GPIO_LED();
    while(1);

    return 0;
}
Example #3
0
static int add_children(struct i2c_client *client)
{
	static const struct {
		int offset;
		char *label;
	} config_inputs[] = {
		/* 8 == right after the LEDs */
		{ 8 + 0, "sw6_1", },
		{ 8 + 1, "sw6_2", },
		{ 8 + 2, "sw6_3", },
		{ 8 + 3, "sw6_4", },
		{ 8 + 4, "NTSC/nPAL", },
	};

	struct device	*child;
	int		status;
	int		i;

	/* GPIO-ish stuff */
	dm355evm_msp_gpio.parent = &client->dev;
	status = gpiochip_add_data(&dm355evm_msp_gpio, NULL);
	if (status < 0)
		return status;

	/* LED output */
	if (msp_has_leds()) {
#define GPIO_LED(l)	.name = l, .active_low = true
		static struct gpio_led evm_leds[] = {
			{ GPIO_LED("dm355evm::ds14"),
				.default_trigger = "heartbeat", },
			{ GPIO_LED("dm355evm::ds15"),
Example #4
0
File: main.c Project: coocox/Mplib
// Application Entry
int main(void)
{
    // LED Demo
    GPIO_LED();

    while(1);
}
Example #5
0
	.buttons        = gpio_buttons,
	.nbuttons       = ARRAY_SIZE(gpio_buttons),
};

static struct platform_device gpio_keys_device = {
	.name   = "gpio-keys",
	.id     = -1,
	.dev    = {
		.platform_data  = &gpio_key_info,
	},
};

#define GPIO_LED(n, g) { .name = n, .gpio = g }

static struct gpio_led gpio_leds[] = {
	GPIO_LED("G", GPIO_PORT20), 
	GPIO_LED("H", GPIO_PORT21), 
	GPIO_LED("J", GPIO_PORT22), 
};

static struct gpio_led_platform_data gpio_leds_info = {
	.leds		= gpio_leds,
	.num_leds	= ARRAY_SIZE(gpio_leds),
};

static struct platform_device gpio_leds_device = {
	.name   = "leds-gpio",
	.id     = -1,
	.dev    = {
		.platform_data  = &gpio_leds_info,
	},
	.nbuttons       = ARRAY_SIZE(gpio_buttons),
};

static struct platform_device gpio_keys_device = {
	.name   = "gpio-keys",
	.id     = -1,
	.dev    = {
		.platform_data  = &gpio_key_info,
	},
};

/* GPIO LED */
#define GPIO_LED(n, g) { .name = n, .gpio = g }

static struct gpio_led gpio_leds[] = {
	GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */
	GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */
	GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */
};

static struct gpio_led_platform_data gpio_leds_info = {
	.leds		= gpio_leds,
	.num_leds	= ARRAY_SIZE(gpio_leds),
};

static struct platform_device gpio_leds_device = {
	.name   = "leds-gpio",
	.id     = -1,
	.dev    = {
		.platform_data  = &gpio_leds_info,
	},
Example #7
0
	.nbuttons       = ARRAY_SIZE(gpio_buttons),
	.poll_interval  = 250, /* polled for now */
};

static struct platform_device gpio_keys_device = {
	.name   = "gpio-keys-polled", /* polled for now */
	.id     = -1,
	.dev    = {
		.platform_data  = &gpio_key_info,
	},
};

#define GPIO_LED(n, g) { .name = n, .gpio = g }

static struct gpio_led gpio_leds[] = {
	GPIO_LED("V2513", GPIO_PORT153), /* PORT153 [TPU1T02] -> V2513 */
	GPIO_LED("V2514", GPIO_PORT199), /* PORT199 [TPU4TO1] -> V2514 */
	GPIO_LED("V2515", GPIO_PORT197), /* PORT197 [TPU2TO1] -> V2515 */
	GPIO_LED("KEYLED", GPIO_PORT163), /* PORT163 [TPU3TO0] -> KEYLED */
	GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */
	GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */
	GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */
};

static struct gpio_led_platform_data gpio_leds_info = {
	.leds		= gpio_leds,
	.num_leds	= ARRAY_SIZE(gpio_leds),
};

static struct platform_device gpio_leds_device = {
	.name   = "leds-gpio",