Re: [PATCH v1 3/3] soc: samsung: usi: implement support for USIv1
From: Krzysztof Kozlowski
Date: Sat Jan 04 2025 - 05:35:25 EST
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