From: Nikita Shubin Date: Sat, 1 Apr 2023 16:35:54 +0000 (+0300) Subject: ts7250: pretend we have i2s X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=74a05ecbe9b08a5350dab2adbf8a6ff061ba6b40;p=linux.git ts7250: pretend we have i2s --- diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 12eff8c8074df..e59344d9b34b5 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -31,6 +31,8 @@ #include "soc.h" #include "ts72xx.h" +#include + /************************************************************************* * IO map *************************************************************************/ @@ -303,9 +305,27 @@ static struct platform_device ts73xx_fpga_device = { #endif +/************************************************************************* + * EDB93xx I2S + *************************************************************************/ +static struct platform_device edb93xx_audio_device = { + .name = "edb93xx-audio", + .id = -1, +}; + +static void __init edb93xx_register_i2s(void) +{ + ep93xx_register_i2s(); + platform_device_register(&edb93xx_audio_device); +} + /************************************************************************* * SPI Bus *************************************************************************/ +static struct cs4271_platform_data edb93xx_cs4271_data = { + .gpio_nreset = EP93XX_GPIO_LINE_H(2), +}; + static struct spi_board_info ts72xx_spi_devices[] __initdata = { { .modalias = "tmp122", @@ -313,6 +333,14 @@ static struct spi_board_info ts72xx_spi_devices[] __initdata = { .bus_num = 0, .chip_select = 0, }, + { + .modalias = "cs4271", + .platform_data = &edb93xx_cs4271_data, + .max_speed_hz = 6000000, + .bus_num = 0, + .chip_select = 1, + .mode = SPI_MODE_3, + }, }; static struct gpiod_lookup_table ts72xx_spi_cs_gpio_table = { @@ -320,6 +348,7 @@ static struct gpiod_lookup_table ts72xx_spi_cs_gpio_table = { .table = { /* DIO_17 */ GPIO_LOOKUP("F", 2, "cs", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("A", 6, "cs", GPIO_ACTIVE_LOW), { }, }, }; @@ -345,6 +374,7 @@ static void __init ts72xx_init_machine(void) gpiod_add_lookup_table(&ts72xx_spi_cs_gpio_table); ep93xx_register_spi(&ts72xx_spi_info, ts72xx_spi_devices, ARRAY_SIZE(ts72xx_spi_devices)); + edb93xx_register_i2s(); } MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC") diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c index 7b6cdc9c8a238..8f4f7d317bc26 100644 --- a/sound/soc/cirrus/edb93xx.c +++ b/sound/soc/cirrus/edb93xx.c @@ -53,7 +53,7 @@ static const struct snd_soc_ops edb93xx_ops = { SND_SOC_DAILINK_DEFS(hifi, DAILINK_COMP_ARRAY(COMP_CPU("ep93xx-i2s")), - DAILINK_COMP_ARRAY(COMP_CODEC("spi0.0", "cs4271-hifi")), + DAILINK_COMP_ARRAY(COMP_CODEC("spi0.1", "cs4271-hifi")), DAILINK_COMP_ARRAY(COMP_PLATFORM("ep93xx-i2s"))); static struct snd_soc_dai_link edb93xx_dai = {