diff options
author | Peter Chen <peter.chen@freescale.com> | 2014-01-10 00:51:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-13 18:55:19 -0500 |
commit | 1071055e2a118a81c0b300d7f4af7eba3f7a7c82 (patch) | |
tree | dc308d2b377ed8f3fcffcfe9043390775d9e7379 /drivers/usb/chipidea/ci_hdrc_imx.c | |
parent | ed8f8318d2ef3e5f9e4ddf79349508c116b68d7f (diff) |
usb: chipidea: imx: set CI_HDRC_IMX28_WRITE_FIX for imx28
Due to imx28 needs ARM swp instruction for writing, we set
CI_HDRC_IMX28_WRITE_FIX for imx28.
This patch is needed for stable tree 3.11+
Cc: stable@vger.kernel.org
Cc: robert.hodaszi@digi.com
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.c')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index bb5d976e5b81..c00f77257d36 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c | |||
@@ -23,6 +23,26 @@ | |||
23 | #include "ci.h" | 23 | #include "ci.h" |
24 | #include "ci_hdrc_imx.h" | 24 | #include "ci_hdrc_imx.h" |
25 | 25 | ||
26 | #define CI_HDRC_IMX_IMX28_WRITE_FIX BIT(0) | ||
27 | |||
28 | struct ci_hdrc_imx_platform_flag { | ||
29 | unsigned int flags; | ||
30 | }; | ||
31 | |||
32 | static const struct ci_hdrc_imx_platform_flag imx27_usb_data = { | ||
33 | }; | ||
34 | |||
35 | static const struct ci_hdrc_imx_platform_flag imx28_usb_data = { | ||
36 | .flags = CI_HDRC_IMX_IMX28_WRITE_FIX, | ||
37 | }; | ||
38 | |||
39 | static const struct of_device_id ci_hdrc_imx_dt_ids[] = { | ||
40 | { .compatible = "fsl,imx28-usb", .data = &imx28_usb_data}, | ||
41 | { .compatible = "fsl,imx27-usb", .data = &imx27_usb_data}, | ||
42 | { /* sentinel */ } | ||
43 | }; | ||
44 | MODULE_DEVICE_TABLE(of, ci_hdrc_imx_dt_ids); | ||
45 | |||
26 | struct ci_hdrc_imx_data { | 46 | struct ci_hdrc_imx_data { |
27 | struct usb_phy *phy; | 47 | struct usb_phy *phy; |
28 | struct platform_device *ci_pdev; | 48 | struct platform_device *ci_pdev; |
@@ -82,6 +102,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
82 | CI_HDRC_DISABLE_STREAMING, | 102 | CI_HDRC_DISABLE_STREAMING, |
83 | }; | 103 | }; |
84 | int ret; | 104 | int ret; |
105 | const struct of_device_id *of_id = | ||
106 | of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev); | ||
107 | const struct ci_hdrc_imx_platform_flag *imx_platform_flag = of_id->data; | ||
85 | 108 | ||
86 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); | 109 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
87 | if (!data) { | 110 | if (!data) { |
@@ -115,6 +138,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
115 | 138 | ||
116 | pdata.phy = data->phy; | 139 | pdata.phy = data->phy; |
117 | 140 | ||
141 | if (imx_platform_flag->flags & CI_HDRC_IMX_IMX28_WRITE_FIX) | ||
142 | pdata.flags |= CI_HDRC_IMX28_WRITE_FIX; | ||
143 | |||
118 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); | 144 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
119 | if (ret) | 145 | if (ret) |
120 | goto err_clk; | 146 | goto err_clk; |
@@ -173,12 +199,6 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev) | |||
173 | return 0; | 199 | return 0; |
174 | } | 200 | } |
175 | 201 | ||
176 | static const struct of_device_id ci_hdrc_imx_dt_ids[] = { | ||
177 | { .compatible = "fsl,imx27-usb", }, | ||
178 | { /* sentinel */ } | ||
179 | }; | ||
180 | MODULE_DEVICE_TABLE(of, ci_hdrc_imx_dt_ids); | ||
181 | |||
182 | static struct platform_driver ci_hdrc_imx_driver = { | 202 | static struct platform_driver ci_hdrc_imx_driver = { |
183 | .probe = ci_hdrc_imx_probe, | 203 | .probe = ci_hdrc_imx_probe, |
184 | .remove = ci_hdrc_imx_remove, | 204 | .remove = ci_hdrc_imx_remove, |