> -/* GPIO Pull-Up status */
> -#define DISABLE_PULL_UP 0
> -#define ENABLE_PULL_UP 1
> +#define U300_OUTPUT_LOW { \
> + .output = true, \
> + .outval = 0, \
> +}
>
> -#define GPIO_NOT_USED 0
> -#define GPIO_IN 1
> -#define GPIO_OUT 2
> +#define U300_OUTPUT_HIGH { \
> + .output = true, \
> + .outval = 1, \
> +}
>
> -struct u300_gpio_configuration_data {
> - unsigned char pin_usage;
> - unsigned char default_output_value;
> - unsigned char pull_up;
> -};
>
> /* Initial configuration */
> -const struct u300_gpio_configuration_data
> -u300_gpio_config[U300_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
> -#ifdef CONFIG_MACH_U300_BS335
> +static const struct __initdata u300_gpio_confdata
> +bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
> /* Port 0, pins 0-7 */
> {
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
> + U300_FLOATING_INPUT,
> + U300_OUTPUT_HIGH,
> + U300_FLOATING_INPUT,
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> },
> /* Port 1, pins 0-7 */
> {
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_HIGH, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> + U300_PULL_UP_INPUT,
> + U300_FLOATING_INPUT,
> + U300_OUTPUT_HIGH,
> + U300_OUTPUT_LOW,
> + U300_OUTPUT_LOW,
> },
> /* Port 2, pins 0-7 */
> {
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP}
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_OUTPUT_LOW,
> + U300_PULL_UP_INPUT,
> + U300_OUTPUT_LOW,
> + U300_PULL_UP_INPUT,
> },
> /* Port 3, pins 0-7 */
> {
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, ENABLE_PULL_UP},
> - {GPIO_OUT, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP}
> + U300_PULL_UP_INPUT,
> + U300_OUTPUT_LOW,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> + U300_FLOATING_INPUT,
> },
> /* Port 4, pins 0-7 */
> {
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_LOW, DISABLE_PULL_UP},
> - {GPIO_IN, DEFAULT_OUTPUT_