Return-Path: Date: Sun, 18 Mar 2018 07:49:49 -0500 From: Rob Herring To: Sebastian Reichel Cc: Thierry Escande , Marcel Holtmann , Bjorn Andersson , Andy Gross , Johan Hedberg , David Brown , Mark Rutland , Andy Shevchenko , Loic Poulain , Srinivas Kandagatla , Linux Bluetooth mailing list , linux-arm-msm@vger.kernel.org, devicetree , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/3] dt-bindings: net: bluetooth: Add qualcomm-bluetooth Message-ID: <20180318003443.qzpgkc4pi6enkwm7@rob-hp-laptop> References: <20180314155514.3374-1-thierry.escande@linaro.org> <20180314155514.3374-3-thierry.escande@linaro.org> <20180314183043.GX18510@minitux> <20180314190522.GY18510@minitux> <494C4C44-1949-405E-91DA-1B40100ED2E6@holtmann.org> <20180315134645.sp3ru2mk6lpqyrda@earth.universe> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180315134645.sp3ru2mk6lpqyrda@earth.universe> List-ID: On Thu, Mar 15, 2018 at 02:46:45PM +0100, Sebastian Reichel wrote: > Hi Thierry, > > On Thu, Mar 15, 2018 at 12:07:44PM +0100, Thierry Escande wrote: > > > > BT_DISABLE_N is the name of this pin in the datasheet of the QCA chip, > > > > not on the board, so this name is the same regardless of what you name > > > > the line or gpio your board connect it to. > > > > > > and QCA chip v1 and QCA chip v2 will use the same driver and > > > same firmware loading mechanism. So why do we have to add a new > > > GPIO naming if they decide to change the name in the data sheet. > > > With Bluetooth it is pretty much all the same. Every UART chip > > > has a shutdown/reset GPIO to enable/disable the chip behind the > > > UART. > > > > > > > > A new board should not require driver changes, you just ship a new DT > > > > > for that board and an existing driver hopefully just does the job. No > > > > > matter how someone named a GPIO in a piece of paper. > > > > > > > > > > > > > I totally agree with the fact that the board should not affect the > > > > naming of the gpio in the driver. But I do enjoy when we refer to pins > > > > by their real name - instead of having to guess which pin in the _chip_ > > > > specification the driver actually refer to. > > > > > > > > > > > > That said, what name would you prefer for this? > > > > > > > > Afaict this is not "wakeup" and there are a few extra steps between the > > > > disabled state and "bluetooth is enabled", so "enable" feels slightly > > > > wrong. And it probably should be "bluetooth" and not just "device" as > > > > this refers to a pin on a WiFi/BT combo chip. > > > > > > The Broadcom side called it shutdown GPIO, it is essentially the > > > shutdown/reset GPIO or power on/off GPIO. Personally I do not > > > care what it is named, but it will be all the same for all > > > Bluetooth chips. Take a poll from Broadcom, Intel, Realtek and > > > Qualcomm and you can pick a reasonable common name. > > > > The Nokia driver has "bluetooth-wakeup" gpio. The Broadcom one has > > "device-wakeup" and "shutdown". The "shutdown" gpio is set to its active > > state to power on the chip which sounds reversed logic. Same for the > > "bt-disable-n" gpio in the Qualcomm driver, configured as ACTIVE_HIGH, and > > which is set to 1 to enable it... > > > > So for consistency, naming it as "shutdown" to stick to the bcm driver but > > it should be configured as ACTIVE_LOW in the dts so we actually do a > > gpiod_set_value(0) to un-shutdown it. Does that sound ok? > > FWIW you picked the wrong gpio from the nokia bluetooth binding. The > gpio for shutdown would be "reset". The "bluetooth-wakeup" is > required for normal operation to exit idle mode. The "reset" name > used by the nokia binding is quite common for DT: > > Documentation/devicetree/bindings $ git grep reset-gpios | wc -l > 212 > > I guess it only makes sense when the device is actually being > reset, though (i.e. for Nokia the settings are back to defaults > and you need to re-upload the FW). The standardish names are reset-gpios, enable-gpios, and powerdown-gpios. Pick one or some of those. Rob