On Tue, Apr 16, 2024 at 05:50:57PM +0800, Chen Wang wrote:[......]
Without "bulk", I have to prepare/disable two times for each of clocks and handle the exception if first one failed etc. I learn this from rockchip, it has 3. Why you think it is not suitable, please advise me, thanks.+#define SG2042_MAX_CLKS 2I don't think "bulk" is suitable here for max 2 clks, no?
+struct sg2042_priv {useless either
+ struct clk_bulk_data clks[SG2042_MAX_CLKS];
+magic "2" needs a meaningful macro definition.
+ /* Set ATDL_CNFG, tuning clk not use for init */
+ val = FIELD_PREP(PHY_ATDL_CNFG_INPSEL_MASK, 2);
+static const struct sdhci_pltfm_data sdhci_dwcmshc_sg2042_pdata = {is "wp-inverted" property better?
+ .ops = &sdhci_dwcmshc_sg2042_ops,
+ .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
+ SDHCI_QUIRK_INVERTED_WRITE_PROTECT,
+Interesting, only "card" and "timer", so which clk is for clk input of the ip?
+static int dwcmshc_sg2042_init(struct device *dev,
+ struct sdhci_host *host,
+ struct dwcmshc_priv *dwc_priv)
+{
+ int err;
+ struct sg2042_priv *soc = NULL;
+
+ soc = devm_kzalloc(dev, sizeof(struct sg2042_priv), GFP_KERNEL);
+ if (!soc)
+ return -ENOMEM;
+
+ soc->clks[0].id = "card";
+ soc->clks[1].id = "timer";