From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb <linux-usb@vger.kernel.org>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Stefan Agner <stefan@agner.ch>,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH] usb: usb3503: Convert to use GPIO descriptors
Date: Fri, 6 Dec 2019 12:42:58 +0100 [thread overview]
Message-ID: <402598f1-3230-c48f-c1c0-feda19cb2261@samsung.com> (raw)
In-Reply-To: <CACRpkdaV9zoVzpZ3SW-Nvjo6ytUCEjA6fWuW1FSBciQ24j5SZg@mail.gmail.com>
Hi Linus,
On 06.12.2019 10:56, Linus Walleij wrote:
> On Fri, Dec 6, 2019 at 10:14 AM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> On 06.12.2019 08:55, Marek Szyprowski wrote:
>>> NAK.
>>>
>>> Sorry, but this patch breaks USB3503 HUB operation on Arndale5250
>>> board. A brief scan through the code reveals that the whole control
>>> logic for the 'intn' gpio is lost.
>> Well, I've checked further and 'intn' logic is there. The issue with
>> Arndale5250 board is something different. Changing the gpio active
>> values in arch/arm/boot/dts/exynos5250-arndale.dts from GPIO_ACTIVE_LOW
>> to GPIO_ACTIVE_HIGH fixed operation of usb3503 HUB. I really wonder why
>> it worked fine with non-descriptor code and the ACTIVE_LOW DT flags...
>>
>> I'm not sure how to handle this. Old code works also fine with DT flags
>> changed to GPIO_ACTIVE_HIGH, which seems to be a proper value for those
>> gpio lines.
> We should of course fix up the device trees so the polarity in them
> is correct.
Okay. I've checked the driver and dts:
According to the USB3503 datasheet, reset-gpios should be ACTIVE_LOW
probably for the all boards. The driver itself should be then fixed to
set reset line to the opposite values: HIGH (ASSERTED) during probe and
suspend, and LOW (DE-ASSERTED) during normal operation.
With the above assumptions, the following DTS should be fixed:
arch/arm/boot/dts/exynos4412-odroid-common.dtsi: invert RESET gpio
polarity (to ACTIVE_LOW)
arch/arm/boot/dts/exynos5250-arndale.dts: invert CONNECT gpio polarity
(to ACTIVE_HIGH)
arch/arm/boot/dts/exynos5410-odroidxu.dts: invert RESET gpio polarity
(to ACTIVE_LOW)
arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dts: invert RESET
gpio polarity (to ACTIVE_LOW), not sure about INTN gpio
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts: invert RESET gpio
polarity (to ACTIVE_LOW)
I've tested such changes with your patch on Odroid X2, U3, XU and
Arndale boards - USB3503 worked fine.
I can prepare patchset with the above changes (dts and the driver logic).
> If the compatibility with elder device trees is mandatory I will make
> a quirk into the gpiolib-of.c that enforce active high on this specific
> GPIO line. This is pretty straight-forward, I can just use the compatible
> of the board and usb3503 in combination to enforce it.
Frankly, I don't care about compatibility with old dtbs. It is already
broken by other changes in the bindings.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2019-12-06 11:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20191205145641eucas1p1e3f40dff8a0c8e9ca47425e2370eabbb@eucas1p1.samsung.com>
2019-12-05 14:56 ` [PATCH] usb: usb3503: Convert to use GPIO descriptors Linus Walleij
2019-12-06 7:55 ` Marek Szyprowski
2019-12-06 9:14 ` Marek Szyprowski
2019-12-06 9:56 ` Linus Walleij
2019-12-06 11:42 ` Marek Szyprowski [this message]
2019-12-06 13:43 ` Linus Walleij
2019-12-09 16:33 ` Marek Szyprowski
2019-12-10 23:13 ` Linus Walleij
2019-12-11 8:48 ` Marek Szyprowski
2019-12-06 9:58 ` Linus Walleij
2019-12-06 11:52 ` Marek Szyprowski
2019-12-06 13:21 ` Linus Walleij
2019-12-06 13:33 ` Marek Szyprowski
2019-12-06 13:38 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=402598f1-3230-c48f-c1c0-feda19cb2261@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=chunfeng.yun@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzk@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-usb@vger.kernel.org \
--cc=stefan@agner.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).