Received: by 10.213.65.68 with SMTP id h4csp1585856imn; Thu, 15 Mar 2018 04:09:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELukx+2At/I0yXyKKQt3hwND1j18O/tG5r01ylWxEJwVA+B0I7kcc+OxJLAOWsmfaekoQOcD X-Received: by 2002:a17:902:183:: with SMTP id b3-v6mr7811556plb.80.1521112153187; Thu, 15 Mar 2018 04:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521112153; cv=none; d=google.com; s=arc-20160816; b=TXg7tIhNM8OjYNvBMl33Q3UrM8YvUQoyb89WsrYskCXmb5n4qbJMnQ1+J1AydKCKBR JzleDK7kVKNFipWpPWbkZGQE4iwwmneXu3ei3vlcvls2hFDUfUJJHz8JEQ3iLqmF92gH heHge6dJD+vEB2/QhXU7Gpedv6OHCGIHlks596mDOhjOdUwTh5NeZnlf09jxPuJNcW4z R55VWa7xzxn4pXuWchGkwjAy1L0kVsgs0XyhqJjAtEwwC2q3ccAhNC/0L1A5tabZcuwv q3sYncJ81RZoxzvzFmhcWrzDV0Zrz7tkIyosn2cGMKGP91HWsT06wt5Mzd1SrgMntCBJ Wpag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=a49x7CRHSZnmnVL2m7rav5TC7aq6t6iLE9DMxEb27/U=; b=JGFvOaKL+GVWU2RV/8kAKzFSQLkEoCd5HXNSQXsr0f+nrnjKjU7YMmA8Yu0eBzcH1f q3QrCy8UwgXm8MJBJvi5WUysxf4Zsjd6BeZJilSqeUyCF6IVoKfQ4MP4h0JxMNFgkyZu +3Xr0NsoQkksWX79KivHAFz3+GhYAFQ/NBiBg8tPqXZZB4nZ9dY9VEfH5heOxsKdn0YL kaIduDLKgENK+PC6Ilwn77RogZ4kVgOrxscKsDwi5i/qxiu60l+nuzkJ1ljAQEFm0JC2 VyYGZfUIU7DqjKF5jkJyOpW5WB3ipgk3MyuIEC3nGOxSPQ0+KWpa++2Ghd6Hi/d//X6W Jbkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Us43BaON; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64-v6si3816549pli.78.2018.03.15.04.08.58; Thu, 15 Mar 2018 04:09:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Us43BaON; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752171AbeCOLHu (ORCPT + 99 others); Thu, 15 Mar 2018 07:07:50 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:43968 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020AbeCOLHs (ORCPT ); Thu, 15 Mar 2018 07:07:48 -0400 Received: by mail-wr0-f196.google.com with SMTP id o1so7799879wro.10 for ; Thu, 15 Mar 2018 04:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=a49x7CRHSZnmnVL2m7rav5TC7aq6t6iLE9DMxEb27/U=; b=Us43BaONPCZAtOYcJfehBay4076heKqBR4k3qXmHvkYdkLYh6Yjc/4UQVDCT/I1hy3 ZeAqkg+IWJsCjHIoKOetubrbfROtSnaTALGYJOuqSdiTZhmZtvYLlbxdOQ6UI4rR8rCG gViaqExVuNtja8K2zdp1Dvv5Lw7WaJpIgiExw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=a49x7CRHSZnmnVL2m7rav5TC7aq6t6iLE9DMxEb27/U=; b=kBfrKUTwo34c1R/hVaR52bUBznF5Mu/qVyT1LncbCSTTdWIhzPGxIBRUD1reLBSe1w zB4aRHmx1X0qsnijlRA6jwJWTjOJhkeIsGihpJtFhKSSR16ItK5tbon/nBXMy2iHmgVe t7yvq851jMLOYjf+uKTqis80utaHVG4g8AKfHh6JGMMqvJpQ2M++s/OMoYHf8wu7UGaM nPl8iZ6v09NKeeIOhV1OC6uywyRkVPYrm0c2LhijFu8CJat/JIwEevTlkgFM5iBYH0na 4f1X5VT0j0Xf5DR7zbh45Yjkjb0p/ntdzeusuvqxtD2f+hIR8d6KjzV4qHPHyHTvXjKI 7gdw== X-Gm-Message-State: AElRT7FMS8E94tY6iXdGLG7ITKDggJDGFIO7Vi5mbOgtnGg/2LTy0qZm RQ9Y1eWui3wAKhLQRbJcJSkihnWdmYs= X-Received: by 10.223.176.98 with SMTP id g31mr6589531wra.256.1521112066494; Thu, 15 Mar 2018 04:07:46 -0700 (PDT) Received: from [192.168.1.100] (aig34-1-88-167-228-121.fbx.proxad.net. [88.167.228.121]) by smtp.gmail.com with ESMTPSA id k18sm4606320wmd.4.2018.03.15.04.07.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 04:07:45 -0700 (PDT) Subject: Re: [PATCH v4 2/3] dt-bindings: net: bluetooth: Add qualcomm-bluetooth To: Marcel Holtmann Cc: Bjorn Andersson , Rob Herring , 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 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> From: Thierry Escande Message-ID: Date: Thu, 15 Mar 2018 12:07:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <494C4C44-1949-405E-91DA-1B40100ED2E6@holtmann.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marcel, On 14/03/2018 20:51, Marcel Holtmann wrote: > Hi Bjorn, > >>>>>> + bt-disable-n-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>; >>>>> >>>>> can we use a common name here. I think that Nokia and Broadcom drivers >>>>> define one. And if this is the enable/shutdown GPIO, we should name it >>>>> consistently across all manufacturers. It essentially does the same on >>>>> Bluetooth UART chips no matter what chip is behind them. >>>>> >>>> >>>> Broadcomm has a device-wakup-gpios and Nokia has bluetooth-wakup-gpios. >>>> It might be that these behave in the same way, but from the description >>>> they only trigger the wakeup. >>> >>> that is something that we might need to start fixing. I really prefer >>> if we name the GPIOs a bit more consistent. >>> >>>> The reason for the proposed naming here is that the pin is named >>>> "BT_DISABLE_N" in the datasheet. >>> >>> That is not a reason I buy. So the next board comes around that labels >>> it in the data sheet BT_DISABLE_YEAH_SUPER_GREAT and you send me a >>> patch to the driver to look for that name. If the GPIO does the same >>> thing, I couldn’t care less what the data sheet says. That might be >>> a comment in the DT file, but it should not pollute the driver code. >>> >> >> 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? Regards, Thierry > For the wakeup GPIOs, these are different and depend on if there is some low-power mode provided. You would need to check the data sheet to see if they provide more advanced low-power state handling. > > Regards > > Marcel >