On Thu, Jul 27, 2017 at 07:46:07PM +0300, Dmitry Osipenko wrote:
> From: Thierry Reding <tred...@nvidia.com>
> 
> All of these Tegra SoC generations have a ChipIdea UDC IP block that can
> be used for device mode communication with a host. Implement rudimentary
> support that doesn't allow switching between host and device modes.
> 
> Signed-off-by: Thierry Reding <tred...@nvidia.com>
> [dig...@gmail.com: rebased patches and added DMA alignment quirk for Tegra20]
> Signed-off-by: Dmitry Osipenko <dig...@gmail.com>
> Acked-by: Peter Chen <peter.c...@nxp.com>

This works on my Asus TF300T (Tegra3 device). Minor nit below.

Tested-by: Michał Mirosław <mirq-li...@rere.qmqm.pl> (on tf300t)

[...]
> diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c 
> b/drivers/usb/chipidea/ci_hdrc_tegra.c
> new file mode 100644
> index 000000000000..7814500e71fa
> --- /dev/null
> +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c
> @@ -0,0 +1,160 @@
[...]
> +struct tegra_udc_soc_info {
> +     bool supports_unaligned_dma;
> +};
[...]
> +static const struct tegra_udc_soc_info tegra20_udc_soc_info = {
> +     .supports_unaligned_dma = false,
> +};
> +
> +static const struct tegra_udc_soc_info tegra30_udc_soc_info = {
> +     .supports_unaligned_dma = true,
> +};
> +
> +static const struct tegra_udc_soc_info tegra114_udc_soc_info = {
> +     .supports_unaligned_dma = true,
> +};
> +
> +static const struct tegra_udc_soc_info tegra124_udc_soc_info = {
> +     .supports_unaligned_dma = true,
> +};
> +
> +static const struct of_device_id tegra_udc_of_match[] = {
> +     {
> +             .compatible = "nvidia,tegra20-udc",
> +             .data = &tegra20_udc_soc_info,
> +     }, {
> +             .compatible = "nvidia,tegra30-udc",
> +             .data = &tegra30_udc_soc_info,
> +     }, {
> +             .compatible = "nvidia,tegra114-udc",
> +             .data = &tegra114_udc_soc_info,
> +     }, {
> +             .compatible = "nvidia,tegra124-udc",
> +             .data = &tegra124_udc_soc_info,
> +     }, {
> +             /* sentinel */
> +     }
> +};
> +MODULE_DEVICE_TABLE(of, tegra_udc_of_match);
[...]
> +static int tegra_udc_probe(struct platform_device *pdev)
> +{
[...]
> +     /* setup device specific quirks */
> +     soc = id->data;
> +
> +     if (!soc->supports_unaligned_dma)
> +             udc->data.flags |= CI_HDRC_REQUIRES_ALIGNED_DMA;
[...]

Some lines would be saved if this was just:

udc->data.flags |= id->data;

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to