linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Thierry Reding" <treding@nvidia.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Maxime Ripard" <maxime.ripard@free-electrons.com>,
	"Jarkko Sakkinen" <jarkko.sakkinen@linux.intel.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"Discussions about the Letux Kernel"
	<letux-kernel@openphoenux.org>,
	kernel@pyra-handheld.com, "Marcel Holtmann" <marcel@holtmann.org>
Subject: Re: [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth
Date: Tue, 23 May 2017 08:10:55 -0500	[thread overview]
Message-ID: <CAL_JsqK5NxL+rHU2enW0Lo+e+HThp-iK3hpW-UxeFREbivRZOw@mail.gmail.com> (raw)
In-Reply-To: <0D94BEA0-F98D-48F6-9DDC-99F932AE7834@goldelico.com>

+Marcel

On Tue, May 23, 2017 at 7:48 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote:
> Hi Rob,
>
>> Am 23.05.2017 um 14:28 schrieb Rob Herring <robh+dt@kernel.org>:
>>
>> On Tue, May 23, 2017 at 12:43 AM, H. Nikolaus Schaller
>> <hns@goldelico.com> wrote:
>>> Hi Rob,
>>>
>>>> Am 23.05.2017 um 04:26 schrieb Rob Herring <robh+dt@kernel.org>:
>>>>
>>>> On Sun, May 21, 2017 at 5:44 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote:
>>>>> Since our proposed API was not acceptable and the new serdev API has arrived in 4.11 kernels,
>>>>> we finally took the challenge to update the w2sg and w2cbw drivers to use the serdev API.
>>>>>
>>>>> The approach is to write a "man in the middle" driver which is on one side a serdev client
>>>>> which directly controls the UART where the device is connected to and on the other side
>>>>> presents a new tty port so that user-space software can talk to the chips as if they would
>>>>> directly talk to the UART of the SoC (e.g. ttyO1). This is similar to connecting to a remote
>>>>> serial device e.g. through USB (ttyACM) or Bluetooth UART profiles.
>>>>>
>>>>> For example gpsd or hciattach expect a /dev/tty they can control (flow control, baud rate
>>>>> etc.).
>>>>
>>>> I understand from the prior discussion why you want to pass the data
>>>> thru for gps, but why do you need to do that for BT?
>>>
>>> Because we otherwise can't turn on power when /dev/ttyBT0 is opened and turn off when it
>>> is closed. I.e. it should not be powered unless someone does a hciattach /dev/ttyBT0. And it
>>> should be turned off by a killall hciattach.
>>
>> Still, you can do power control within BT HCI drivers.
>
> We do not use any driver for bluetooth. We just start hciattach on demand.
> And afaik there is no plugin mechanism for adding power control to hciattach.

You don't need hciattach. All userspace has to do for kernel BT
drivers is "hciconfig hci0 up|down".

> Or do you have a link to what you think about?

Look at the nokia BT or TI (HCI_LL) BT drivers. Those both have f/w
downloading and some GPIO controls. Given that this module is based on
Marvell chipset, I'd expect you need to add serdev support to
hci_mrvl.c.

>> You wouldn't be
>> limited to just open/close, but can handle suspend/resume as well.
>
> Well, it does not look as if we need more than open/close since suspend/resume
> is already handled by the regulator driver. We just need to keep it powered off
> if there is no user-space client.

Okay.

Rob

  reply	other threads:[~2017-05-23 13:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-21 10:44 [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth H. Nikolaus Schaller
2017-05-21 10:44 ` [RFC 1/3] DTS: gta04: add serdev nodes for w2sg00x4, w2cbw etc H. Nikolaus Schaller
2017-05-21 10:44 ` [RFC 2/3] misc: Add w2sg0004 (gps receiver) power control driver H. Nikolaus Schaller
2017-05-21 10:48   ` H. Nikolaus Schaller
2017-05-30 23:09   ` Rob Herring
2017-06-06 18:50     ` H. Nikolaus Schaller
2017-06-07  7:34   ` Ladislav Michl
2017-06-07 10:08     ` H. Nikolaus Schaller
2017-05-21 10:44 ` [RFC 3/3] misc: Add w2cbw003 (wifi/bluetooth) " H. Nikolaus Schaller
2017-05-23  2:26 ` [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth Rob Herring
2017-05-23  5:43   ` H. Nikolaus Schaller
2017-05-23 12:28     ` Rob Herring
2017-05-23 12:48       ` H. Nikolaus Schaller
2017-05-23 13:10         ` Rob Herring [this message]
2017-05-23 13:49           ` H. Nikolaus Schaller
2017-05-25 12:48             ` Rob Herring
2017-06-06 18:50               ` H. Nikolaus Schaller
2017-05-25 17:05             ` Pavel Machek

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=CAL_JsqK5NxL+rHU2enW0Lo+e+HThp-iK3hpW-UxeFREbivRZOw@mail.gmail.com \
    --to=robh+dt@kernel.org \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hns@goldelico.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=kernel@pyra-handheld.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marcel@holtmann.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=tony@atomide.com \
    --cc=treding@nvidia.com \
    /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).