From: Chris Ruehl <chris.ruehl-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
To: Heikki Krogerus
<heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: balbi-l0cyMroinI0@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/3] usb: phy-generic: Add ULPI VBUS support
Date: Wed, 04 Dec 2013 15:16:21 +0800 [thread overview]
Message-ID: <529ED6C5.3000608@gtsys.com.hk> (raw)
In-Reply-To: <20131203081556.GA26423@xps8300>
On Tuesday, December 03, 2013 04:15 PM, Heikki Krogerus wrote:
> On Mon, Dec 02, 2013 at 03:05:19PM +0800, Chris Ruehl wrote:
>> @@ -154,6 +164,27 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
>> {
>> int err;
>>
>> + if (nop->ulpi_vbus> 0) {
>> + unsigned int flags = 0;
>> +
>> + if (nop->ulpi_vbus& 0x1)
>> + flags |= ULPI_OTG_DRVVBUS;
>> + if (nop->ulpi_vbus& 0x2)
>> + flags |= ULPI_OTG_DRVVBUS_EXT;
>> + if (nop->ulpi_vbus& 0x4)
>> + flags |= ULPI_OTG_EXTVBUSIND;
>> + if (nop->ulpi_vbus& 0x8)
>> + flags |= ULPI_OTG_CHRGVBUS;
>> +
>> + nop->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, flags);
>> + if (!nop->ulpi) {
>> + dev_err(dev, "Failed create ULPI Phy\n");
>> + return -ENOMEM;
>> + }
>> + dev_dbg(dev, "Create ULPI Phy\n");
>> + nop->ulpi->io_priv = nop->viewport;
>> + }
>
> This is so wrong. You are registering one kind of usb phy driver from
> an other. Change drivers/usb/phy/ulpi.c to be a platform device. The
> whole flag system in it is pretty horrid. While you are at it, change
> that so it sets the values based on boolean flags from OF properties
> or platform data.
>
> NAK for the whole set.
>
>
Heikki,
Thanks for your comments, even not much positive to me.. any how.
My intention on the "horrid" path was to reduce kernel code where
one of_read32 vs. four of_boolean. And mentioned logic is simple. But that's
history.
On my way to find a solution for my board I'd look around and found using of
phy-ulpi.c functions in phy-tegra-usb.c and don't mind to use them too.
I accept your NAK and will work on a patch to make phy-ulpi.c working as
platform device.
Last question to you. What you don't like on the patch to support chip-select
gpio of my patch-set.. I ask because you NAK the whole set.
I really need the ChipSelect function to make my hardware work!
Chris
--
GTSYS Limited RFID Technology
A01 24/F Gold King Industrial Bld
35-41 Tai Lin Pai Road, Kwai Chung, Hong Kong
Fax (852) 8167 4060 - Tel (852) 3598 9488
Disclaimer: http://www.gtsys.com.hk/email/classified.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Chris Ruehl <chris.ruehl@gtsys.com.hk>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: balbi@ti.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] usb: phy-generic: Add ULPI VBUS support
Date: Wed, 04 Dec 2013 15:16:21 +0800 [thread overview]
Message-ID: <529ED6C5.3000608@gtsys.com.hk> (raw)
In-Reply-To: <20131203081556.GA26423@xps8300>
On Tuesday, December 03, 2013 04:15 PM, Heikki Krogerus wrote:
> On Mon, Dec 02, 2013 at 03:05:19PM +0800, Chris Ruehl wrote:
>> @@ -154,6 +164,27 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_gen_xceiv *nop,
>> {
>> int err;
>>
>> + if (nop->ulpi_vbus> 0) {
>> + unsigned int flags = 0;
>> +
>> + if (nop->ulpi_vbus& 0x1)
>> + flags |= ULPI_OTG_DRVVBUS;
>> + if (nop->ulpi_vbus& 0x2)
>> + flags |= ULPI_OTG_DRVVBUS_EXT;
>> + if (nop->ulpi_vbus& 0x4)
>> + flags |= ULPI_OTG_EXTVBUSIND;
>> + if (nop->ulpi_vbus& 0x8)
>> + flags |= ULPI_OTG_CHRGVBUS;
>> +
>> + nop->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, flags);
>> + if (!nop->ulpi) {
>> + dev_err(dev, "Failed create ULPI Phy\n");
>> + return -ENOMEM;
>> + }
>> + dev_dbg(dev, "Create ULPI Phy\n");
>> + nop->ulpi->io_priv = nop->viewport;
>> + }
>
> This is so wrong. You are registering one kind of usb phy driver from
> an other. Change drivers/usb/phy/ulpi.c to be a platform device. The
> whole flag system in it is pretty horrid. While you are at it, change
> that so it sets the values based on boolean flags from OF properties
> or platform data.
>
> NAK for the whole set.
>
>
Heikki,
Thanks for your comments, even not much positive to me.. any how.
My intention on the "horrid" path was to reduce kernel code where
one of_read32 vs. four of_boolean. And mentioned logic is simple. But that's
history.
On my way to find a solution for my board I'd look around and found using of
phy-ulpi.c functions in phy-tegra-usb.c and don't mind to use them too.
I accept your NAK and will work on a patch to make phy-ulpi.c working as
platform device.
Last question to you. What you don't like on the patch to support chip-select
gpio of my patch-set.. I ask because you NAK the whole set.
I really need the ChipSelect function to make my hardware work!
Chris
--
GTSYS Limited RFID Technology
A01 24/F Gold King Industrial Bld
35-41 Tai Lin Pai Road, Kwai Chung, Hong Kong
Fax (852) 8167 4060 - Tel (852) 3598 9488
Disclaimer: http://www.gtsys.com.hk/email/classified.html
next prev parent reply other threads:[~2013-12-04 7:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 7:05 [PATCH] usb: phy-generic, phy-ulpi patch set Chris Ruehl
[not found] ` <1385967919-13258-1-git-send-email-chris.ruehl-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
2013-12-02 7:05 ` [PATCH 1/3] usb: phy-generic: Add GPIO based ChipSelect Chris Ruehl
2013-12-02 7:05 ` Chris Ruehl
[not found] ` <1385967919-13258-2-git-send-email-chris.ruehl-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
2013-12-06 20:24 ` Felipe Balbi
2013-12-06 20:24 ` Felipe Balbi
[not found] ` <20131206202453.GF21086-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2013-12-09 1:45 ` Chris Ruehl
2013-12-09 1:45 ` Chris Ruehl
2013-12-09 4:07 ` Felipe Balbi
2013-12-09 4:07 ` Felipe Balbi
[not found] ` <20131209040705.GB20608-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2013-12-09 4:11 ` Chris Ruehl
2013-12-09 4:11 ` Chris Ruehl
2013-12-02 7:05 ` [PATCH 2/3] usb: phy-ulpi: Add EXTVBUSIND,CHRGVBUS flag support Chris Ruehl
2013-12-02 7:05 ` Chris Ruehl
2013-12-02 18:59 ` Sergei Shtylyov
2013-12-02 7:05 ` [PATCH 3/3] usb: phy-generic: Add ULPI VBUS support Chris Ruehl
[not found] ` <1385967919-13258-4-git-send-email-chris.ruehl-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
2013-12-02 18:22 ` Mark Rutland
2013-12-02 18:22 ` Mark Rutland
[not found] ` <20131202182204.GQ12952-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-12-03 2:46 ` Chris Ruehl
2013-12-03 2:46 ` Chris Ruehl
2013-12-03 5:24 ` Chris Ruehl
2013-12-03 8:15 ` Heikki Krogerus
2013-12-04 7:16 ` Chris Ruehl [this message]
2013-12-04 7:16 ` Chris Ruehl
[not found] ` <529ED6C5.3000608-CR359r9tUDPXPF5Rlphj1Q@public.gmane.org>
2013-12-04 9:49 ` Heikki Krogerus
2013-12-04 9:49 ` Heikki Krogerus
2013-12-05 4:15 ` Chris Ruehl
2013-12-05 4:15 ` Chris Ruehl
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=529ED6C5.3000608@gtsys.com.hk \
--to=chris.ruehl-cr359r9tudpxpf5rlphj1q@public.gmane.org \
--cc=balbi-l0cyMroinI0@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=heikki.krogerus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.