示例#1
0
文件: raumfeld.c 项目: 020gzh/linux
 * USB (OHCI) support
 */

static struct pxaohci_platform_data raumfeld_ohci_info = {
	.port_mode      = PMM_GLOBAL_MODE,
	.flags		= ENABLE_PORT1,
};

/**
 * Rotary encoder input device
 */

static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
	.dev_id = "rotary-encoder.0",
	.table = {
		GPIO_LOOKUP_IDX("gpio-0",
				GPIO_VOLENC_A, NULL, 0, GPIO_ACTIVE_LOW),
		GPIO_LOOKUP_IDX("gpio-0",
				GPIO_VOLENC_B, NULL, 1, GPIO_ACTIVE_HIGH),
		{ },
	},
};

static struct property_entry raumfeld_rotary_properties[] = {
	PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24),
	PROPERTY_ENTRY_INTEGER("linux,axis",			  u32, REL_X),
	PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis",	  u32, 1),
	{ },
};

static struct property_set raumfeld_rotary_property_set = {
	.properties = raumfeld_rotary_properties,
示例#2
0
文件: core.c 项目: 12zz/linux
	ep93xx_eth_data = *data;
	platform_device_register(&ep93xx_eth_device);
}


/*************************************************************************
 * EP93xx i2c peripheral handling
 *************************************************************************/

/* All EP93xx devices use the same two GPIO pins for I2C bit-banging */
static struct gpiod_lookup_table ep93xx_i2c_gpiod_table = {
	.dev_id		= "i2c-gpio",
	.table		= {
		/* Use local offsets on gpiochip/port "G" */
		GPIO_LOOKUP_IDX("G", 1, NULL, 0,
				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
		GPIO_LOOKUP_IDX("G", 0, NULL, 1,
				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
	},
};

static struct platform_device ep93xx_i2c_device = {
	.name		= "i2c-gpio",
	.id		= 0,
	.dev		= {
		.platform_data	= NULL,
	},
};

/**
 * ep93xx_register_i2c - Register the i2c platform device.
static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
	.name		= "wifi_rfkill",
	.reset_gpio	= 25, /* PD1 */
	.shutdown_gpio	= 85, /* PK5 */
	.type	= RFKILL_TYPE_WLAN,
};

static struct platform_device wifi_rfkill_device = {
	.name	= "rfkill_gpio",
	.id	= -1,
	.dev	= {
		.platform_data = &wifi_rfkill_platform_data,
	},
};

static struct gpiod_lookup_table wifi_gpio_lookup = {
	.dev_id = "rfkill_gpio",
	.table = {
		GPIO_LOOKUP_IDX("tegra-gpio", 25, NULL, 0, 0),
		GPIO_LOOKUP_IDX("tegra-gpio", 85, NULL, 1, 0),
		{ },
	},
};

void __init tegra_paz00_wifikill_init(void)
{
	gpiod_add_lookup_table(&wifi_gpio_lookup);
	platform_device_register(&wifi_rfkill_device);
}
示例#4
0
		.platform_data = &gpr_led_data,
	}
};

/*
 * I2C
 */
static struct gpiod_lookup_table gpr_i2c_gpiod_table = {
	.dev_id = "i2c-gpio",
	.table = {
		/*
		 * This should be on "GPIO2" which has base at 200 so
		 * the global numbers 209 and 210 should correspond to
		 * local offsets 9 and 10.
		 */
		GPIO_LOOKUP_IDX("alchemy-gpio2", 9, NULL, 0,
				GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP_IDX("alchemy-gpio2", 10, NULL, 1,
				GPIO_ACTIVE_HIGH),
	},
};

static struct i2c_gpio_platform_data gpr_i2c_data = {
	/*
	 * The open drain mode is hardwired somewhere or an electrical
	 * property of the alchemy GPIO controller.
	 */
	.sda_is_open_drain	= 1,
	.scl_is_open_drain	= 1,
	.udelay			= 2,		/* ~100 kHz */
	.timeout		= HZ,
};