[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-usb
Subject: Re: [PATCH v2 3/8] usb: chipidea: Add support for Tegra20/30/114/124
From: Dmitry Osipenko <digetx () gmail ! com>
Date: 2017-07-31 10:13:42
Message-ID: 0c409a4d-07b3-29bc-dafd-2e573c6975c6 () gmail ! com
[Download RAW message or body]
On 31.07.2017 04:14, Peter Chen wrote:
> On Fri, Jul 28, 2017 at 05:51:16PM +0200, Michał Mirosław wrote:
>> On Fri, Jul 28, 2017 at 01:00:32PM +0300, Dmitry Osipenko wrote:
>>> On 28.07.2017 01:32, Michał Mirosław wrote:
>>>> On Thu, Jul 27, 2017 at 07:46:07PM +0300, Dmitry Osipenko wrote:
>>>>> From: Thierry Reding <treding@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 <treding@nvidia.com>
>>>>> [digetx@gmail.com: rebased patches and added DMA alignment quirk for Tegra20]
>>>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>>>> Acked-by: Peter Chen <peter.chen@nxp.com>
>>>>
>>>> This works on my Asus TF300T (Tegra3 device). Minor nit below.
>>>>
>>>> Tested-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> (on tf300t)
>>>>
>>>
>>> Nice, thank you!
>>>
>>>> [...]
>>>>> 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;
>>>>
>
> I prefer this way too, and add CI_HDRC_REQUIRES_ALIGNED_DMA as
> platform flags for necessary SoCs.
>
Okay, please let me know if there are any other nitpicks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic