linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnd Bergmann <arnd@arndb.de>, Brad Larson <brad@pensando.io>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Mark Brown <broonie@kernel.org>,
	Serge Semin <fancer.lancer@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Olof Johansson <olof@lixom.net>,
	dac2@pensando.io,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	DTML <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support
Date: Thu, 7 Apr 2022 10:13:21 +0300	[thread overview]
Message-ID: <3c8e94e1-fb8e-0d8f-4e79-b8313a1da5cb@intel.com> (raw)
In-Reply-To: <CAK8P3a1RdHTngDVqg4KnVA3N8EjDfbpQ=cEcz_CK8NmG2EgYLQ@mail.gmail.com>

On 07/04/2022 9.45, Arnd Bergmann wrote:
> On Thu, Apr 7, 2022 at 1:36 AM Brad Larson <brad@pensando.io> wrote:
>> @@ -350,7 +461,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc,
>>  static int sdhci_cdns_probe(struct platform_device *pdev)
>>  {
>>         struct sdhci_host *host;
>> -       const struct sdhci_pltfm_data *data;
>> +       const struct sdhci_cdns_drv_data *data;
>>         struct sdhci_pltfm_host *pltfm_host;
>>         struct sdhci_cdns_priv *priv;
>>         struct clk *clk;
>> @@ -369,10 +480,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
>>
>>         data = of_device_get_match_data(dev);
>>         if (!data)
>> -               data = &sdhci_cdns_pltfm_data;
>> +               data = &sdhci_cdns_drv_data;
>>
>>         nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node);
>> -       host = sdhci_pltfm_init(pdev, data,
>> +       host = sdhci_pltfm_init(pdev, &data->pltfm_data,
>>                                 struct_size(priv, phy_params, nr_phy_params));
>>         if (IS_ERR(host)) {
>>                 ret = PTR_ERR(host);
>> @@ -389,6 +500,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
>>         host->ioaddr += SDHCI_CDNS_SRS_BASE;
>>         host->mmc_host_ops.hs400_enhanced_strobe =
>>                                 sdhci_cdns_hs400_enhanced_strobe;
>> +       if (data->init) {
>> +               ret = data->init(pdev);
>> +               if (ret)
>> +                       goto free;
>> +       }
>>         sdhci_enable_v4_mode(host);
>>         __sdhci_read_caps(host, &version, NULL, NULL);
> 
> I'm not sure about the abstraction here. The approach of having a single
> driver with some platform specific quirks like you do here works fine if the
> differences between hardware implementations are fairly minor, but if there
> are a larger number of variants, or the differences become too big, the
> better approach is to have separate top-level driver instances that call
> into a more generic driver, continuing the call chain
> 
> elba_drv_init()
>  -> sdhci_cdns_probe()
>      -> sdhci_pltfm_init()
>          -> sdhci_add_host()
>              -> mmc_add_host()
> 
> with each one being a more specific version of the one below it.
> At the moment, it doesn't quite require having a custom driver,
> but I fear that it it would get hard to rework if it continues to grow
> other front-ends. It may be better to do the abstraction right away,
> even if the elba driver becomes rather trivial.
> 
> Ulf, any preferences?
> 

What is the relationship between cadence and pensando elba?

  reply	other threads:[~2022-04-07  7:13 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 23:36 [PATCH 00/11] Support Pensando Elba SoC Brad Larson
2022-04-06 23:36 ` [PATCH 01/11] dt-bindings: arm: add Pensando boards Brad Larson
2022-04-07 18:45   ` Krzysztof Kozlowski
2022-04-09  2:19     ` Brad Larson
2022-04-09 10:39       ` Krzysztof Kozlowski
2022-04-11 21:24         ` Serge Semin
2022-05-25 16:31         ` Brad Larson
2022-04-07 18:54   ` Krzysztof Kozlowski
2022-04-09  2:04     ` Brad Larson
2022-04-06 23:36 ` [PATCH 02/11] dt-bindings: Add vendor prefix for Pensando Systems Brad Larson
2022-04-07 18:43   ` Krzysztof Kozlowski
2022-04-09  2:00     ` Brad Larson
2022-04-06 23:36 ` [PATCH 03/11] dt-bindings: mmc: Add Pensando Elba SoC binding Brad Larson
2022-04-07  6:30   ` Arnd Bergmann
2022-05-25 15:46     ` Brad Larson
2022-04-07 18:57   ` Krzysztof Kozlowski
2022-05-25 15:49     ` Brad Larson
2022-04-06 23:36 ` [PATCH 04/11] dt-bindings: spi: Add compatible for Pensando Elba SoC Brad Larson
2022-04-07 18:59   ` Krzysztof Kozlowski
2022-05-25 16:58     ` Brad Larson
2022-04-12 11:37   ` Serge Semin
2022-05-25 17:03     ` Brad Larson
2022-04-06 23:36 ` [PATCH 05/11] dt-bindings: spi: dw: Add Pensando Elba SoC SPI Controller bindings Brad Larson
2022-04-07 18:52   ` Krzysztof Kozlowski
2022-04-11 21:17     ` Serge Semin
2022-05-26  0:27     ` Brad Larson
2022-04-12 11:29   ` Serge Semin
2022-04-06 23:36 ` [PATCH 06/11] MAINTAINERS: Add entry for PENSANDO Brad Larson
2022-04-06 23:36 ` [PATCH 07/11] arm64: Add config for Pensando SoC platforms Brad Larson
2022-04-06 23:36 ` [PATCH 08/11] spi: cadence-quadspi: Add compatible for Pensando Elba SoC Brad Larson
2022-04-06 23:36 ` [PATCH 09/11] mmc: sdhci-cadence: Add Pensando Elba SoC support Brad Larson
2022-04-07  6:45   ` Arnd Bergmann
2022-04-07  7:13     ` Adrian Hunter [this message]
2022-04-07 17:06       ` Brad Larson
2022-04-07 20:38         ` Arnd Bergmann
2022-05-25 16:10           ` Brad Larson
2022-04-06 23:36 ` [PATCH 10/11] spi: dw: Add support for Pensando Elba SoC Brad Larson
2022-04-12 11:06   ` Serge Semin
2022-05-25 21:54     ` Brad Larson
2022-04-06 23:36 ` [PATCH 11/11] arm64: dts: Add Pensando Elba SoC support Brad Larson
2022-04-07  7:57   ` Marc Zyngier
2022-04-09  2:38     ` Brad Larson
2022-04-09  9:18       ` Marc Zyngier
2022-05-25 17:28         ` Brad Larson
2022-04-07 19:06   ` Krzysztof Kozlowski
2022-05-26  0:19     ` Brad Larson
2022-05-26  6:53       ` Krzysztof Kozlowski
2022-04-07 20:58   ` Krzysztof Kozlowski
2022-04-12 11:22   ` Serge Semin
2022-05-25 20:06     ` Brad Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c8e94e1-fb8e-0d8f-4e79-b8313a1da5cb@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=brad@pensando.io \
    --cc=broonie@kernel.org \
    --cc=dac2@pensando.io \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).