Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp272528lqd; Wed, 24 Apr 2024 01:35:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdqkB+jNKH7NIESlvgIxRdDIL4bKuOzZWxwytqe1rIaIVK1O4o12FE3JZVRdj1BxMoGgG/eZfh8Tljylc2UngZQoileKJBnnAUhjYS1A== X-Google-Smtp-Source: AGHT+IH4yHY6uavfjWQL+1dUTsPomOBsDXyqilwgPPt+Y/RwbGcCITtBMkue84e7oGGpqA16C+eb X-Received: by 2002:ae9:f205:0:b0:78b:d7a8:84f0 with SMTP id m5-20020ae9f205000000b0078bd7a884f0mr2134345qkg.46.1713947743227; Wed, 24 Apr 2024 01:35:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713947743; cv=pass; d=google.com; s=arc-20160816; b=k+Iq6YLQEXH9GkUwIWIJbu3jmwnEsaNq8xMg9MOvrtbffdbz3oVyKHa/rksCM4gxab 6XXHkQj5WbBtBgAKQ3Q+Kd0syYPPhndd2JPkmbp9cbbG6XuF833caIbKDDJYZxwJf+bd 4KoGPLptTh/x5zyvFqh9AlqDG7hsc/gw487N70b5g5NJARBc7ibLrTGipgqhcHO0avH9 2Qmt+SPctHn8ZhWKry78pOANq7pFzQxjFJYT30Y+6PNhw8ltOdEmoc9aCRbU/qH9VQFz 5awnKaj+aTcgfteBEAnrLCw6sgmvi5cArWhg+A/HovUpfIzPW2AiXaMWBwG8sQ/1Xd75 6eIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=vDFImD9L851v3eokbLJ+e59EKftJ969NRYvO1svYOIo=; fh=qzx0G9tHNBIXdxP2Gucb22FxKfWW5C6O5dn757OlRwI=; b=JjF9tP/Nf3K9boSab9OyQR7ZYAcoJxaDOZ5MBCp8RK8RMcTmI1QH1YF/tV8ZIZE1Hk 0Jt2+bgJrJ1J/95sVgfQMtP8DcBbxnR/ne8P1mCGdGEW+JBWn9AwGpizW7n7deFB3uVk KoVkLA1bic05xK8nMZ07P93mSFop6qUYTd//CkJodVhh/3/hOLL7TCKO+++ui+Cvb8aD pQ6juNa9Cayw8+OvhSo/pDJjthlQQvmcWlCmYXuSuveR0Agfq4s1vTNTVpppuxzheURr EqjS8/cqORUt9DPQNqPhXn+VR4TXYNIl+mUGplT3a74DO5ap1LmJ6JvPikh9ieVv2n3q 8wCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hDI3570V; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h16-20020a37de10000000b0078f0eb3b04csi13640080qkj.713.2024.04.24.01.35.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 01:35:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hDI3570V; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ED1B41C2269A for ; Wed, 24 Apr 2024 08:35:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84EFB156C6B; Wed, 24 Apr 2024 08:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="hDI3570V" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F30E1422C3 for ; Wed, 24 Apr 2024 08:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713947733; cv=none; b=psR5EAyaxu/T16gIkYeti2k91vwS8aR1eSc3Yq08ir4HUybXfW7GseI2IPO1BSlsFod95hPYbDJA5/qZFBJfrfTiH4N3MvAtJjF0XZUSqM1nMWqHttseAR8ZEdBpso7a1/hQ+aQFFOC/DMeMXdhUc/badiJDVHU9gefj3OyGlfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713947733; c=relaxed/simple; bh=w+nZM0SNckJ5URBgPtRzQrUvtDDut74UQ2nlhwet7To=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ErV7lkWRmRHRVBGyR6++VjJ6oha5SoECt1l92qqMFFl7HTqrf6AlV94YECljugG9q/wuCauezmOqoOkaFjZpgOyEe8ThzhQ/VdsG4bQQjJoOyDPatx88EgZy9KESuATXEXj810ERAZPqO8G1ueYCgwf4pD1shQ/gS6nagA5Zt/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=hDI3570V; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43O8TFaT011364; Wed, 24 Apr 2024 08:35:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=vDFImD9L851v3eokbLJ+e59EKftJ969NRYvO1svYOIo=; b=hD I3570VcftHjjzq0p/YugEVHaaZpIS5YcFibYWerfpMgMGynQBvykkIH01BZgp++f KqFFylUBvUS4VK1fGqT/veszVEEpjOFBC/k3bNImLJ7JWdmV5AitRGoM8OEUFbS2 Ohs1ulFyFNYMYnusMylk6LnhY+ofW6UdVCMrFjDZyovEoASQBfVhn4jN/PFP2jPb 1i/2wm2kPjC0LZm9gH6U/0Szis9eQLOzxIaOGmYZVGw7Vo0AlyIWUOFhRUwzQ6kl 121TK3lroiNx6bYTQ9Yn3HZZH5e/EHuca0p6yrNixZ4qn4j9BGV2Bp3Ec09VrmpQ +1mOjeT5QiHS48eve4fA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xpv9gra7b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 08:35:24 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43O8ZMMJ029351 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 08:35:22 GMT Received: from zijuhu-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 24 Apr 2024 01:35:16 -0700 From: Zijun Hu To: , , CC: , , , , , Subject: [PATCH v1] Bluetooth: qca: Correct property enable-gpios handling logic for WCN6750 and WCN6855 Date: Wed, 24 Apr 2024 16:35:12 +0800 Message-ID: <1713947712-4307-1-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: hf3oUbC05QlDFsbrMn1PklslbAVWlhcs X-Proofpoint-ORIG-GUID: hf3oUbC05QlDFsbrMn1PklslbAVWlhcs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-24_06,2024-04-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 phishscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404240036 Commit 56d074d26c58 ("Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional()") has wrong logic for below case: property enable-gpios is not configured for WCN6750 and WCN6855 Function devm_gpiod_get_optional(...,"enable",...) returns NULL for above case, we normaly need to treat it as success case as the commit argued but the property enable-gpios is marked as required by the binding spec Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml so we can't treat it as success case any more since it is a required property but not configured by user. Fix by reverting the commit's impact for WCN6750 and WCN6855, error prompt is also added for this case. Signed-off-by: Zijun Hu --- drivers/bluetooth/hci_qca.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index b621a0a40ea4..5c6bafe008ed 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2328,10 +2328,13 @@ static int qca_serdev_probe(struct serdev_device *serdev) qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR(qcadev->bt_en) && + if (IS_ERR_OR_NULL(qcadev->bt_en) && (data->soc_type == QCA_WCN6750 || data->soc_type == QCA_WCN6855)) { - dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n"); + if (IS_ERR(qcadev->bt_en)) + dev_err(&serdev->dev, "failed to acquire BT_EN gpio\n"); + else + dev_err(&serdev->dev, "required BT_EN gpio is not configured\n"); power_ctrl_enabled = false; } -- 2.7.4