Received: by 10.213.65.68 with SMTP id h4csp1688116imn; Thu, 15 Mar 2018 06:56:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELtaSJhatxDQz8pj3C4Kk5+ZLJoCT17ainNZsKatkEIOQDOIIkgzE9q1GLXuGZAK8z258GjQ X-Received: by 10.167.130.208 with SMTP id f16mr5931156pfn.164.1521122173622; Thu, 15 Mar 2018 06:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521122173; cv=none; d=google.com; s=arc-20160816; b=eHLDYEdk0h1i8YZETqFGyz9/+Mll5lio8liZ4CBOAEGI2JPMi2leSLdt6ulQKL3AhV i4WB/KLmNfqSTCJ+E0zk+ZV0FjrdwSo+bSbPUDHO+CoXvCk1aEOprs29IukboEixOSbq So01vyKKHHpZKEM2APMFevNrgJCcLuk9w8L4M5p1HRSEes0/wPpo4UcVVAXQ0AIzcKtu mIAUGYYAzxQTV5k75ed1zkTtt05kl1KeHgH3SjN2wSe+I100Q7T1WzDk6Q1/OirFhfsx y7MFQlKqOn0ikhQfIHWHRnIcMD6KyCbvHsKFFA1GBAkQSUhQbWZFqYzcAwTzFgv57GFI BdrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=hCbh0KSZxC/x9WeB1tfuEcNw5UAv1uW//KXrF+NFfbU=; b=Mbm210FX2MxBOLL7GqoJV6KhfL2vneJE/lOrJtaeQq9Obq3b+ItWT9LYQm5R8cEH7g 1ateECJZvJzMrw4gnNDuDor4vwbS/bTXectsW3KESElB7n6PFBLulT/j04K5cjZdb6vx Ldu6AiC85wTpbuov9uH4gqZof08kotG8pWxdRFrLpwpOUxLQ5CaiAo2GW6+GRG+lFXd1 6Ems/rrBoEILJRx5fS3VRKzoRdNpaKMK0TazpoJ4xS9xoVe3tkSiUfW7SaC+rnk+iZmC I1jmB7BM7FPhoOfUXXuanhwht5r43exPyTxqaD+rT8RV7u4gVCv44cB29g5HU4x3LWus tZsQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si4051206pll.90.2018.03.15.06.55.59; Thu, 15 Mar 2018 06:56: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096AbeCONzE convert rfc822-to-8bit (ORCPT + 99 others); Thu, 15 Mar 2018 09:55:04 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:37388 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbeCONzD (ORCPT ); Thu, 15 Mar 2018 09:55:03 -0400 Received: from marcel-macpro.fritz.box (p4FF9F617.dip0.t-ipconnect.de [79.249.246.23]) by mail.holtmann.org (Postfix) with ESMTPSA id 1DD17CEEAE; Thu, 15 Mar 2018 15:01:15 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: [PATCH v4 2/3] dt-bindings: net: bluetooth: Add qualcomm-bluetooth From: Marcel Holtmann In-Reply-To: <20180315134645.sp3ru2mk6lpqyrda@earth.universe> Date: Thu, 15 Mar 2018 14:54:59 +0100 Cc: Thierry Escande , 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 Content-Transfer-Encoding: 8BIT Message-Id: <8481B301-0B92-4247-8DC0-A1EDB32325F4@holtmann.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> <20180315134645.sp3ru2mk6lpqyrda@earth.universe> To: Sebastian Reichel X-Mailer: Apple Mail (2.3445.5.20) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sebastian, >>>> 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). that is actually a good point. I like to differentiate between a shutdown GPIO (and we can argue about the inversion here) and the reset GPIO. If we loose the firmware and the programmed BD_ADDR, then it is a hard-reset, otherwise it is shutdown/power GPIO. So can we agree on how we name the hard-reset, shutdown, wakeup etc. GPIOs for Bluetooth UART devices? Regards Marcel