| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * arch/arm/mach-ep93xx/edb93xx.c |
|---|
| 3 | 4 | * Cirrus Logic EDB93xx Development Board support. |
|---|
| .. | .. |
|---|
| 17 | 18 | * EDB9312 |
|---|
| 18 | 19 | * Copyright (C) 2006 Infosys Technologies Limited |
|---|
| 19 | 20 | * Toufeeq Hussain <toufeeq_hussain@infosys.com> |
|---|
| 20 | | - * |
|---|
| 21 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 22 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 23 | | - * the Free Software Foundation; either version 2 of the License, or (at |
|---|
| 24 | | - * your option) any later version. |
|---|
| 25 | 21 | */ |
|---|
| 26 | 22 | |
|---|
| 27 | 23 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 29 | 25 | #include <linux/platform_device.h> |
|---|
| 30 | 26 | #include <linux/i2c.h> |
|---|
| 31 | 27 | #include <linux/spi/spi.h> |
|---|
| 28 | +#include <linux/gpio/machine.h> |
|---|
| 32 | 29 | |
|---|
| 33 | 30 | #include <sound/cs4271.h> |
|---|
| 34 | 31 | |
|---|
| 35 | | -#include <mach/hardware.h> |
|---|
| 32 | +#include "hardware.h" |
|---|
| 36 | 33 | #include <linux/platform_data/video-ep93xx.h> |
|---|
| 37 | 34 | #include <linux/platform_data/spi-ep93xx.h> |
|---|
| 38 | | -#include <mach/gpio-ep93xx.h> |
|---|
| 35 | +#include "gpio-ep93xx.h" |
|---|
| 39 | 36 | |
|---|
| 40 | 37 | #include <asm/mach-types.h> |
|---|
| 41 | 38 | #include <asm/mach/arch.h> |
|---|
| .. | .. |
|---|
| 105 | 102 | }, |
|---|
| 106 | 103 | }; |
|---|
| 107 | 104 | |
|---|
| 108 | | -static int edb93xx_spi_chipselects[] __initdata = { |
|---|
| 109 | | - EP93XX_GPIO_LINE_EGPIO6, |
|---|
| 105 | +static struct gpiod_lookup_table edb93xx_spi_cs_gpio_table = { |
|---|
| 106 | + .dev_id = "spi0", |
|---|
| 107 | + .table = { |
|---|
| 108 | + GPIO_LOOKUP("A", 6, "cs", GPIO_ACTIVE_LOW), |
|---|
| 109 | + { }, |
|---|
| 110 | + }, |
|---|
| 110 | 111 | }; |
|---|
| 111 | 112 | |
|---|
| 112 | 113 | static struct ep93xx_spi_info edb93xx_spi_info __initdata = { |
|---|
| 113 | | - .chipselect = edb93xx_spi_chipselects, |
|---|
| 114 | | - .num_chipselect = ARRAY_SIZE(edb93xx_spi_chipselects), |
|---|
| 114 | + /* Intentionally left blank */ |
|---|
| 115 | 115 | }; |
|---|
| 116 | 116 | |
|---|
| 117 | 117 | static void __init edb93xx_register_spi(void) |
|---|
| .. | .. |
|---|
| 123 | 123 | else if (machine_is_edb9315a()) |
|---|
| 124 | 124 | edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_EGPIO14; |
|---|
| 125 | 125 | |
|---|
| 126 | + gpiod_add_lookup_table(&edb93xx_spi_cs_gpio_table); |
|---|
| 126 | 127 | ep93xx_register_spi(&edb93xx_spi_info, edb93xx_spi_board_info, |
|---|
| 127 | 128 | ARRAY_SIZE(edb93xx_spi_board_info)); |
|---|
| 128 | 129 | } |
|---|