All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andy Shevchenko <andy@infradead.org>, linux-usb@vger.kernel.org
Subject: [v3,1/3] usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources
Date: Thu, 26 Jul 2018 13:54:42 +0300	[thread overview]
Message-ID: <87tvom1d3h.fsf@linux.intel.com> (raw)

Hans de Goede <hdegoede@redhat.com> writes:

> Hi,
>
> On 10-06-18 16:01, Hans de Goede wrote:
>> Bay Trail / BYT SoCs do not have a builtin device-mode phy, instead
>> they require an external ULPI phy for device-mode.
>> 
>> Only some BYT devices have an external phy, but even on those devices
>> device-mode is not working because the dwc3 does not see the phy.
>> 
>> The problem is that the ACPI fwnode for the dwc3 does not contain the
>> expected GPIO resources for the GPIOs connected to the chip-select and
>> reset pins of the phy.
>> 
>> I've found the workaround which some Android x86 kernels use for this:
>> https://github.com/BORETS24/Kernel-for-Asus-Zenfone-2/blob/master/arch/x86/platform/intel-mid/device_libs/pci/platform_usb_otg.c
>> Which boils down to hardcoding the GPIOs for these devices.
>> 
>> The good news it that all boards (*) use the same GPIOs.
>> 
>> This commit fixes the ULPI phy not woring by adding a gpiod_lookup_table
>> call which adds a hardcoded mapping for BYT devices. Note that the mapping
>> added by gpiod_add_lookup_table is a fallback mapping, so boards which
>> properly provide GPIO resources in the ACPI firmware-node resources
>> will not use this.
>> 
>> *) Except for the first revision of the evalulation-kit, which normal users
>> don't have
>> 
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> Changes in v3:
>> -Add the mapping with gpiod_add_lookup_table() unconditionally on BYT
>>   devices, as they are only used after checking for GPIO resources in ACPI
>
> Ping? AFAIK this series is ready for merging now and it is necessary to
> make gadget mode work on all Bay Trail devices which support gadget
> mode.

now queued for v4.19

             reply	other threads:[~2018-07-26 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 10:54 Felipe Balbi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-03 14:43 [v3,1/3] usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources Hans de Goede
2018-06-10 14:01 Hans de Goede

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=87tvom1d3h.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=andy@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-usb@vger.kernel.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.