[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fc357064-b385-428a-8206-0f994a76e1ad@kernel.org>
Date: Sat, 4 Jan 2025 11:35:12 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Ivaylo Ivanov <ivo.ivanov.ivanov1@...il.com>
Cc: Rob Herring <robh@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Alim Akhtar <alim.akhtar@...sung.com>,
Sam Protsenko <semen.protsenko@...aro.org>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-samsung-soc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 3/3] soc: samsung: usi: implement support for USIv1
On 04/01/2025 10:36, Ivaylo Ivanov wrote:
>>> struct exynos_usi_variant {
>>> @@ -66,6 +79,16 @@ struct exynos_usi_mode {
>>> unsigned int val; /* mode register value */
>>> };
>>>
>>> +static const struct exynos_usi_mode exynos_usi_v1_modes[] = {
>>> + [USI_V1_NONE] = { .name = "none", .val = USI_V1_SW_CONF_NONE },
>>> + [USI_V1_I2C0] = { .name = "i2c0", .val = USI_V1_SW_CONF_I2C0 },
>>> + [USI_V1_I2C1] = { .name = "i2c1", .val = USI_V1_SW_CONF_I2C1 },
>>> + [USI_V1_I2C0_1] = { .name = "i2c0_1", .val = USI_V1_SW_CONF_I2C0_1 },
>>> + [USI_V1_SPI] = { .name = "spi", .val = USI_V1_SW_CONF_SPI },
>>> + [USI_V1_UART] = { .name = "uart", .val = USI_V1_SW_CONF_UART },
>>> + [USI_V1_UART_I2C1] = { .name = "uart_i2c1", .val = USI_V1_SW_CONF_UART_I2C1 },
>> Now I see why you duplicated the IDs... With my approach your code here
>> is even simpler. Allows to drop USI_VER1 as well.
>
> We can't really drop USI_VER1, as we'll fall into USIV2-specific code, like so:
> if (usi->data->ver == USI_VER2) return exynos_usi_enable(usi);
Yeah, indeed. You still would have just one exynos_usi_mode table.
Best regards,
Krzysztof
Powered by blists - more mailing lists