Re: [PATCH] mmc: add SDHCI driver for STM platforms (V2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >> 3) In the end, another hook could be added in the sdhci_pltfm_data to
> >>    invoke specific own functions for claiming resources etc.
> >>    For example, I need an extra callback to invoke the STM pad manager
> >>    that's used for managing clocks, PIO lines and syscfg registers.
> >>
> >>    I'm thinking about something like this:
> >>
> >>    struct sdhci_pltfm_data {
> >>         struct sdhci_ops *ops;
> >>         unsigned int quirks;
> >>         int (*init)(struct sdhci_host *host);
> >>         void (*exit)(struct sdhci_host *host);
> >>         int (*claim_resource)(struct platform_device *pdev);
> >>                  |
> >>                  |_ we can use another name.
> >>    };
> > 
> > And init() is too late?
> 
> No it's not late but I need the dev structure from the platform_device.
> We could add the "struct device dev;" in the sdhci_host structure
> instead of.
> In this case the sdhci_host should be moved within the new
> include/linux/mmc/sdhci.h file.
> Indeed, this could make sense because the drivers/mmc/host/sdhci.h will
> only have the HW register configuration. Shared macros (quirks) and
> structures among sdhci driver based could be moved in
> include/linux/mmc/sdhci.h header.
> 
> What do you think?

I think it will be better to give init() access to all information
needed than to implement another hook. I tried with this patch

https://patchwork.kernel.org/patch/196992/

I am still not sure what kind of information you need from the pdev. Can
you create a branch somewhere with your current work?

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux