提交 0dc7a3ec 编写于 作者: J John Keeping 提交者: Ulf Hansson

mmc: dw_mmc: add common capabilities to replace caps

The caps field depends on the mshcN alias ID but for some devices this
is unnecessary as the capabilities are the same for all instances
sharing the same compatible.

Add a common_caps field for this case which updates the host's
capabilities without needing the mshcN alias ID.
Signed-off-by: NJohn Keeping <john@metanate.com>
Tested-by: NNicolas Frattaroli <frattaroli.nicolas@gmail.com>
Reviewed-by: NJaehoon Chung <jh80.chung@samsung.com>
Link: https://lore.kernel.org/r/20211124184603.3897245-2-john@metanate.comSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 e53e97f8
...@@ -2856,6 +2856,9 @@ static int dw_mci_init_slot_caps(struct dw_mci_slot *slot) ...@@ -2856,6 +2856,9 @@ static int dw_mci_init_slot_caps(struct dw_mci_slot *slot)
if (host->pdata->pm_caps) if (host->pdata->pm_caps)
mmc->pm_caps = host->pdata->pm_caps; mmc->pm_caps = host->pdata->pm_caps;
if (drv_data)
mmc->caps |= drv_data->common_caps;
if (host->dev->of_node) { if (host->dev->of_node) {
ctrl_id = of_alias_get_id(host->dev->of_node, "mshc"); ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
if (ctrl_id < 0) if (ctrl_id < 0)
......
...@@ -550,6 +550,8 @@ struct dw_mci_slot { ...@@ -550,6 +550,8 @@ struct dw_mci_slot {
* dw_mci driver data - dw-mshc implementation specific driver data. * dw_mci driver data - dw-mshc implementation specific driver data.
* @caps: mmc subsystem specified capabilities of the controller(s). * @caps: mmc subsystem specified capabilities of the controller(s).
* @num_caps: number of capabilities specified by @caps. * @num_caps: number of capabilities specified by @caps.
* @common_caps: mmc subsystem specified capabilities applicable to all of
* the controllers
* @init: early implementation specific initialization. * @init: early implementation specific initialization.
* @set_ios: handle bus specific extensions. * @set_ios: handle bus specific extensions.
* @parse_dt: parse implementation specific device tree properties. * @parse_dt: parse implementation specific device tree properties.
...@@ -562,6 +564,7 @@ struct dw_mci_slot { ...@@ -562,6 +564,7 @@ struct dw_mci_slot {
struct dw_mci_drv_data { struct dw_mci_drv_data {
unsigned long *caps; unsigned long *caps;
u32 num_caps; u32 num_caps;
u32 common_caps;
int (*init)(struct dw_mci *host); int (*init)(struct dw_mci *host);
void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
int (*parse_dt)(struct dw_mci *host); int (*parse_dt)(struct dw_mci *host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册