Received: by 10.213.65.68 with SMTP id h4csp511751imn; Tue, 13 Mar 2018 11:22:12 -0700 (PDT) X-Google-Smtp-Source: AG47ELtpT+Q59cDOHArb4XicY6xHnr8BK9piEmnohqOPreAkHloe/cv2H8Os01oES+zw4rsA0TDA X-Received: by 10.98.139.18 with SMTP id j18mr1488409pfe.179.1520965332134; Tue, 13 Mar 2018 11:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520965332; cv=none; d=google.com; s=arc-20160816; b=k5RA/UWRxMm3ou1ayZ4UYzEyfAJtxwnd4ye/yC2fvSYtSAjKUFkrzgMTPPjF6wVf+k huxcoR3un5IcIvOfcz+IQCNE5M14e5RDaF8hwcWOiXj5lofbfWHmEVygTW3JO4uAi6nm xl3l+R3T4XjpprkAGNjgYL7TWboO2iF7Y5Z9LCFkxOHDOc1nE86cM6qmnufDwp4Ok9vO IPF3CtYjInSGQ5AAU91qEAnsK90DwOLPXFY962+ikfV4yb+PGKH8FL8y95rmuPSu6C8J iz8UdPI5VwnKLhPMOU/vm7VyX+uC+bvwKYBVr6xiHYLrGfn/eGhEp6aviLmzqLYoJwb/ aZBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=PkmUkPldTVBr4Wi5O5ryAwyfm8JD8KkJwK5Ahka00ew=; b=zXHKqrHtV4Ay0+E+v9tm8hCXLSO2Hx7hHTatMVdOs1jItEWi+QWY0JbJx9RgkxyDPS hkovnCGS+AdbO133BdPAnRcO8Z5UmVyOEY39XhY2mNvIqkKJxv3ct2ipJMoXQg6tYL+5 wweV2jb+Fuvsy+/e4EvTIb8TsZIf7NkOejqiEw1/A/Jgg8Odp1QXtFgS1oeHahnUpkIh RUuhPWJJ+MKZdkYSy4IY9MZ6/ZSh5LlRim4J03ov80915vwnKqJNO+VjbF5XDDZARxL8 SabFnExsa/OMnJQEI/vBVHt2D2QA4rSr+Bs/AeYRvDHcL5DRRBmm0O3zBxFn55yvpNwz 0FAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LoOARx2y; 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 v5-v6si526092ply.427.2018.03.13.11.21.56; Tue, 13 Mar 2018 11:22:12 -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=LoOARx2y; 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 S1752515AbeCMSTk (ORCPT + 99 others); Tue, 13 Mar 2018 14:19:40 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:45689 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226AbeCMSTi (ORCPT ); Tue, 13 Mar 2018 14:19:38 -0400 Received: by mail-oi0-f67.google.com with SMTP id j79so478354oib.12 for ; Tue, 13 Mar 2018 11:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PkmUkPldTVBr4Wi5O5ryAwyfm8JD8KkJwK5Ahka00ew=; b=LoOARx2yUg+zkE0C+NMwBtQriWo5LuFehQlxQSSbOMZulV7JN/WNpljhCbjABW6B1J ZoDjaEALPh/M+df7bTsxyHdX1IKHLfYKOARRo/N8lr28dh0woLtkzb4KwrekH+BWwD8F BGmYqVpWVuJJas9Up4dYGVaggWgbYZFzojj4E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PkmUkPldTVBr4Wi5O5ryAwyfm8JD8KkJwK5Ahka00ew=; b=IB6DAln5cjrd+2fHkv//7+XkErQ2QciBl8LmdF4K4BgfkWsLZWSjp7nRH//4vh8xPE vOeqKrhfnN5X68uZZSNw67KZXDIgW0b+h1ZeqL9lWellE2K4irwr9lG/k+Z4Pk+NFXNU lbtYr9o0pS6BsyD6Kajea4RMn6PTvstyBtqzX5r82ZMAH8Xba2JzTmAPBNzmHRbU+iBK 8qfa6kbkgD2wt6gwBrro1AXg63TiaZwGW4tHWi7eaBj2txyElWf+Ztkg3QsdjMy1jtNn vkr+aM0gY2c55BHjf9v9ySOw/6Nbjow35vRd2BTSiwuEzSkwv3PNJU5aZRd18UtsQD6H x41w== X-Gm-Message-State: AElRT7E9SkUymq49JnY66HWBFAVTHhO6Fxc4/zfKdF0vd1O9JuQyEK5W igTHcpbT6X5zQldy3qvrbPFHqXH/mW6jG9dS4WAgpg== X-Received: by 10.202.59.84 with SMTP id i81mr1055354oia.197.1520965177527; Tue, 13 Mar 2018 11:19:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.44.149 with HTTP; Tue, 13 Mar 2018 11:18:56 -0700 (PDT) In-Reply-To: <20180313160326.18180-4-thierry.escande@linaro.org> References: <20180313160326.18180-1-thierry.escande@linaro.org> <20180313160326.18180-4-thierry.escande@linaro.org> From: Loic Poulain Date: Tue, 13 Mar 2018 19:18:57 +0100 Message-ID: Subject: Re: [PATCH 3/3] Bluetooth: hci_qca: Add serdev support To: Thierry Escande Cc: Rob Herring , Andy Gross , Marcel Holtmann , Johan Hedberg , David Brown , Mark Rutland , Bjorn Andersson , Srinivas Kandagatla , "open list:BLUETOOTH DRIVERS" , linux-arm-msm@vger.kernel.org, devicetree , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13 March 2018 at 17:03, Thierry Escande wrote: > From: Thierry Escande > > Add support for Qualcomm serial slave devices. Probe the serial device, > retrieve its maximum speed and register a new hci uart device. > > Signed-off-by: Thierry Escande > --- > drivers/bluetooth/Kconfig | 2 +- > drivers/bluetooth/hci_qca.c | 102 +++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 101 insertions(+), 3 deletions(-) > > diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig > index 07e55cd8f8c8..c2a6a7ebd14b 100644 > --- a/drivers/bluetooth/Kconfig > +++ b/drivers/bluetooth/Kconfig > @@ -195,7 +195,7 @@ config BT_HCIUART_BCM > > config BT_HCIUART_QCA > bool "Qualcomm Atheros protocol support" > - depends on BT_HCIUART > + depends on BT_HCIUART_SERDEV Driver depends on both BT_HCIUART and BT_HCIUART_SERDEV. > @@ -386,6 +399,7 @@ static void hci_ibs_wake_retrans_timeout(struct timer_list *t) > /* Initialize protocol */ > static int qca_open(struct hci_uart *hu) > { > + struct qca_serdev *qcadev; > struct qca_data *qca; > > BT_DBG("hu %p qca_open", hu); > @@ -444,6 +458,13 @@ static int qca_open(struct hci_uart *hu) > timer_setup(&qca->tx_idle_timer, hci_ibs_tx_idle_timeout, 0); > qca->tx_idle_delay = IBS_TX_IDLE_TIMEOUT_MS; > > + if (hu->serdev) { > + serdev_device_open(hu->serdev); > + > + qcadev = serdev_device_get_drvdata(hu->serdev); > + gpiod_set_value(qcadev->bt_en, 1); I suggest to replace gpiod_set_value calls with the _cansleep version. You always set gpio value from sleepable context and this should avoid any further issue with different gpio controller. Regards, Loic