From patchwork Wed Jan 15 10:46:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Sanjay Kale X-Patchwork-Id: 13940289 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2087.outbound.protection.outlook.com [40.107.241.87]) (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 BA5BD248BA6; Wed, 15 Jan 2025 10:45:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937904; cv=fail; b=WTq2XEx4YWmk64OGwCheWK9La56CnnHDeGBhA++t3K5kzpG+l2FEK/xJD8d06fSEQBl6sJ+17Li1r9T5dY84pZaX7mOChe9H3ifI/nomEwGwh1bCwjQKSJf7q6dVZ0VXibD/XGTadkcJesWeaOPKWoipBE4vVLLoN+vkkOrljsQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937904; c=relaxed/simple; bh=UXFBwP8n2o39BhsKi0NFgENhOeytZWnpR9gm1ihvrDA=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=P+XcmaB+LnGu41ebksdwlFjC5b5ntc+Ru6AH7WKem/2/UfT2didRWBd6TTkaz0d5Zt2Qxo67ZFemrLGV/cRsE6e4PmzejKvR+uQvwKn7syE1UkuX0XRSRDcqfP7RbVYU8O8HvJop/JQbIgB0/4ckAynP63Uo2jFl73h9gH8eBbw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Y3+F64n5; arc=fail smtp.client-ip=40.107.241.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Y3+F64n5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SglLHdGhHEjTFb8IpYueOa70NyF6+a/QeciBzS0+aI/p2pxgk8Ke4vWVN+SMBgBW+DX8KUKOyjmXIAqrfGbP03QobCeu6n3eOlLufdLub+2iLp4crqS+y7ZsjNSgLNAhOb/ZbDOEyM5ORsfQfbN8V9XBvAJlolbRt+SmXP3N92uVHS1BxpJywyuT4BJMl5QN+T6rvIf4d2QkvcC0CMCWJSOur17X3aqfoEIDb9Glm6VgEZ8wXX27uF2t0SHJL2z6ezBWnUHuv9AAg3/9kzmOl59AuOdqYgJiF3j8lpIdn5gjtd5879aMu96oWoXMqCzJKpagLziqYG8tW1yZEv+OGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Wnt7D0xmhRmbMDNItJVqgX7AXuEhW/3g5ueF26sw/bk=; b=kjERkS8itoDM9uFV0B9ji5up9V8fglZeNsfw3bkox5LMD+zgMMdD/4HghbMOpJPzxjaVPTYDoYCAz9R7HJmj7lcz7VzhBaPfkHGk24CLVR0WMUI05gh/PPOg5BTVW6bm2o1h3TEMvlNcoswH5iEu6zYZ8Vq5AQO+5C7hrY2IFblgf/51a70uOU31yUwdWHJlDA0ZZjat/+9AwPPpeQyaHkftKy66+syj3RqPV5ECuXDggcTA6Y1GLvZhFRlKV3AqChnmPGNCmvJm5mKmV//+b2Hx1pO6jB+7rCIlEkBEJBGXOkoK0toegwpu9nom4qol1lWaObUyW0svkt4SzC6uig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wnt7D0xmhRmbMDNItJVqgX7AXuEhW/3g5ueF26sw/bk=; b=Y3+F64n5QUYHuimzWpfV2wEufLbf7+iqjyx0/XC4Wmp/dysY7ZLYeJHrXeIB5AFx5Lj1GrNh+nS7qo/SWVtegEPB7E2cT8Om3TdPSF6EQgUephf3+2t4Warnzs1Utei/Pk0lmHVSW/17BteExqqLgxkdGJN2zAJwJRpuhnO56mo1o2yJgp+PfoFwsH8LoA6ifAft2etkeB6Sy+eXzyghfOWlqMtMDm1rqfkn60LDZI8y0mZNbWNHqAfv6R2Q2pPpbc8teIKIskdqjnlD8quL/kG/glbavN/vCiwe74Xlm7Rci5/eK5mnU+6Mqkrm5BPmXCHavOQLQLsLpI0/TpBMMQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS4PR04MB9692.eurprd04.prod.outlook.com (2603:10a6:20b:4fe::20) by DU2PR04MB9180.eurprd04.prod.outlook.com (2603:10a6:10:2f7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Wed, 15 Jan 2025 10:44:59 +0000 Received: from AS4PR04MB9692.eurprd04.prod.outlook.com ([fe80::a2bf:4199:6415:f299]) by AS4PR04MB9692.eurprd04.prod.outlook.com ([fe80::a2bf:4199:6415:f299%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025 10:44:59 +0000 From: Neeraj Sanjay Kale To: marcel@holtmann.org, luiz.dentz@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, amitkumar.karwar@nxp.com, neeraj.sanjaykale@nxp.com, sherry.sun@nxp.com, ziniu.wang_1@nxp.com, johan.korsnes@remarkable.no, kristian.krohn@remarkable.no, manjeet.gupta@nxp.com Subject: [PATCH v4 1/2] dt-bindings: net: bluetooth: nxp: Add support to set BD address Date: Wed, 15 Jan 2025 16:16:13 +0530 Message-Id: <20250115104614.2381674-1-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2PR02CA0009.apcprd02.prod.outlook.com (2603:1096:4:194::11) To AS4PR04MB9692.eurprd04.prod.outlook.com (2603:10a6:20b:4fe::20) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR04MB9692:EE_|DU2PR04MB9180:EE_ X-MS-Office365-Filtering-Correlation-Id: 784c1b90-d50d-4d99-af50-08dd3551a88a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|7416014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: yBPDZCYLV2EZUQYiFMpBwXqr9scqvQ6MMpiVzxxa8bczJVQJY7vFuin1cLkDDge8ixzdsyYT1yiKNbsPtnYB3FTGUz6JEEPb6ASFMEErDt7n/yQS4wM1vbmqzt6a5uTo/BCrNA28XVE8QX23R9DSTS1bVVdXf3ZSZWCIzZiHUEP5okSiUt4RTgPrpZDNsvW8n7vfs7j2nRd1uUEw0J5iINAYSbZ7iSofFgDUglKTMZLTzF+QjFoEqppxM10Sxaeez3vfhBuclZy0U7JijiT9mTbJb09ScanYmTsgh0pWRTuF7ZmPlTBTt9tZf4XbNyBc2pGF0WRIXeYnvl1JVopu9AEb+7RJhacK8a7G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7+P4PnzmBjjEdi9VKu4b X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR04MB9692.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +eQwe1/9XP/4hW3ffRqfHIGFJG0C+FZbT5dqWI5epqwYdaVQ2I2kahimmGV7aJjP7BlsBfBJCDuJ35R50iMqjJ4b/eXNXWO/vLExUwJzCwkm4AvH6uxrY+NS/CL7EU80OJFcTI/nSM0vbYF/L3l5lmOUS/E82TGDGApqJluHCR3W2Rra0SHEVR8SAcbEHv/tc7xoMhQjoKZxNtovln6UVQ7716qIuQFad2ZhvVQiB+bN6Bm/2cChO66oghGtDKSV+KuU8xlpms71C9pWe1YOndWINK71ZaP6V9r+KeL8wAK8GAOjO5kEtDZn7eYoMyPeYPlQvQItcxZHgleMW1DZgQPpelU+ZLN5Nq7RN9xbB83+p73y9O058BSmf3Z22jPPTdL8sxIEUgBOk89lS07CyDoML55j9EgBk01yFvgVOZTj8zUy6hFOBUJbGfSu75/duVWLLQ1SaRiDTqDqv2FWCStB9ZVbNRIa+daXMajF8R+KxcNv01TRKuOi0cDiuCjajlqV6jINI6PzrEoeoyE6wQTINQY32FbjeK7mXoWIqz0/AX0yZzYrV09iNNQ+g7xeaU2HaMkE9ggpDGexf23caTrUyppUtJSOURbgChOBLUuzXkkm8p7SY2QeGyTtt3WdSgMvSjAf6Ob/v4QcHk6LFKxqPQvLBUZfN5yfNejVnCb5K0XrCaSypmxtJfZ2kNagthST+a35YjaQkIGkHINER3p75o1VaQ6HTMdzSauktqD+dhVl8mhnwabmHzVkFcCJJCQxrTEo8r3mXX5FpW40RDbsoqK9aaRAXNABQgg7rqeoaJYx1QoY3jrjcoLsEGmBLOis5TFqoJRU4lEHWP64zEhgZYH1Gk32b1vpiZh2DoB6cOBM0F5cYelu3z/nRZSC4pZxguhVFD7jYx8XPY/wfpL8Y1lHGbDaLuKvC6F8cai+b3lUqaFOf5+oAH4YtiGD99z1o9FuRddz1oPI20D+gcpomfi64xDpJpH8fCx0mdMRyeHEg/LcrpaC1ePG5Y34JbAZl1/XNIKttJJ7k5MFVdBZ9uL3NfjVmF7rSSagK1jGLd3WRhNnibBb1MGte1RVwcei8N5Lv/3LajRliBuBSzjRpSKC5AujRXII2muhBFiq/KRqW4wkXHcnaiGHZq/OylFjllybZqgtNP8vRP44xlE3xzXlHcPk+KkOI1plLKikBjZ11i816rOJaFO3YCQRLxtzTBUkyRXun65r1ipPXwNn5Fxu6SrvnmNXHCK4xYLIMcjFfSNS4XUOwliDuhZaqkiatzPsd5oIlK4/eJC67j0ThP1XZHZjSASH4pld09ZTcazJA2705/yhowsaM9N2QEnPwj+FjZHLKc840N4Opkbbab/F80BiyNA6xJCHHJiYxpyyPeoVX6rqiCbt8m9PwUkVz+65rDrBgccNl7zLyPWIe2nvMmq53CKaZkOwfFEehsWVd4qcKlfmKFoRbC8cXCvda79psbdcWqu5wiMsyMgEVDippWFeITfhd6rgEb3eIOBJ7XvV4IAA+0HOQ5KG0d7S996E0Dnb93JZl90FjkhKKoBe+127QDFMUzTcc2zeB4EsLBFhiFhM7v+laBvH7ztTQXlSoS05SDg/gKGrUA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 784c1b90-d50d-4d99-af50-08dd3551a88a X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9692.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 10:44:59.6177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aZtqhxWFStdez+PWSao0xUXM/+/kJtCM0YjHH6+HLbYYvJpG04IYjyvXp/z46Fl3y2UQW50rS61skgAF6guJax6Tle0PG+KZHgPpuBeMMCk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9180 Allow user to set custom BD address for NXP chipsets. Signed-off-by: Neeraj Sanjay Kale Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml index 0a2d7baf5db3..499c816071ec 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml @@ -17,6 +17,9 @@ description: maintainers: - Neeraj Sanjay Kale +allOf: + - $ref: bluetooth-controller.yaml# + properties: compatible: enum: @@ -43,7 +46,7 @@ properties: required: - compatible -additionalProperties: false +unevaluatedProperties: false examples: - | @@ -54,5 +57,6 @@ examples: fw-init-baudrate = <3000000>; firmware-name = "uartuart8987_bt_v0.bin"; device-wakeup-gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + local-bd-address = [11 22 33 44 55 66]; }; }; From patchwork Wed Jan 15 10:46:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Neeraj Sanjay Kale X-Patchwork-Id: 13940290 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2087.outbound.protection.outlook.com [40.107.241.87]) (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 31DF1156644; Wed, 15 Jan 2025 10:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937907; cv=fail; b=lN+WG0xm8VAols/c+WEKGkfHlGH2OTzpEJSpI1zuF1QdUDP9FifIAFq6P5GXMT9iPKbmokdUu1atZhDxm+visO3wLp0EuGyHHcgmsqXjan9SoxnodhorpW2KNiHvufD9mKNwPQuBQuJcZ9GFh0XDOGFePYX0jswmp8e83IM9X04= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937907; c=relaxed/simple; bh=09FLFt7CPRqw0H74Tp5wTNa5H8JujFRAXlRT7R9NEBc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ki1V7ibzV4QMXWrSQ3BBnW4cBdGWjkZ3TbvlgeiSD9BvpXxd6xIUvsHP0dELNqKuuma1EQruNnMQOXhr8FwboMn9QqF1kYlR6q6Cj3/IYZPmyqqQT6XjJ/xesisPupHU1JfPpoJTMwnBXc8Qzyrsa2k2c4p0SRnBvxUYdlb3k88= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=B3nL9mjJ; arc=fail smtp.client-ip=40.107.241.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="B3nL9mjJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OklW3BtU6JiW6UZg09vDE/Tw2N6GCIAd0PSZ5hpf2dfrPzjDpc+mF0xuzQDwzTi/Kqu4P56FgoSmJA6rrGZc8O2TkG6YuJzMs0QU6LFJ7OX3zG3cwwfwN9DSERQgWOd13gzc5iHZ93KH2HEpDX4mckVurYN758zO7r0BoWzEg2fUkhQwDwnF5qw06Tu7SMI/YwZbj3J8VP7EuX1KwQrothPzfzAhYEyYqNl6EOFUrOF9wDvD2+BuogOKtJ7VjZ+Kv4sU7mtYU8RsIqkwqSpkgQKAbzpUzEKUYbFASYdnpnngUCCr2cS8AXSEjobk6/JBwET/5UGHJoIO3rN5XkSL/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B094ROyfelAXhuEfHOLnG8f0c1McKjS2hRphp+ggeWU=; b=AjPxhAVIXcKHRvgWFr7ODgjC8+r3Fj3pjCfEYdwcMaivPB2JHINy/EyDK4rGg8hDeeU0IZ626DJ0CZ7wfqF/KIuS3jR3/iejsXQELUZuiX4dD3dbdxwjQJ18XS9h0FmMShvUCKJz8m/QFgmyynww2dBnVRMtzETh0Xmox3A8LC83Hx8PmGMT1nOQsS1RAwpFw52Oter/nq+C5Pe7bn3ofwOjrOgSa5YpXXFzODlSbbLvmH3pHjyjvB6iqkZN4DZAsqM++NjUgOHwT1N2D2EIC2Bk54AymfwoMvsT2KWHQVmNSvGjM6TrmPm7txjJpIYqUv6fnz5jkcBT94mMoIUTSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B094ROyfelAXhuEfHOLnG8f0c1McKjS2hRphp+ggeWU=; b=B3nL9mjJ34V+DTm2/SSvYS8dYZQJS8xqrAY43h6lY8pO5Itg+hoG2BxKJrjwAC7BgSJuLLR9xzETzcVe2HhRRdm72stok62LT+kELqwbLS38A+dfNboEgJxnyMZXdiPRxpOwdR0WSOuX7ORG8M4aPt/vs9XE1g6m5nM6WVC0UNe4h1XMZ/IfEtSbZXUQEYYwZHESqE6ETUcaOX6AQ920f8mu+eEMERt4aqFg9/uBK79Sv8FcG66CUpPsbCv1ab9uCLubcasqCwhDZc0MMI3dgt+s85/S6enLQ09OHH4FtRV8CAsyqatb7nW92HA2AcKnh99ebDJkcTokDgTFBnvYmQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS4PR04MB9692.eurprd04.prod.outlook.com (2603:10a6:20b:4fe::20) by DU2PR04MB9180.eurprd04.prod.outlook.com (2603:10a6:10:2f7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Wed, 15 Jan 2025 10:45:03 +0000 Received: from AS4PR04MB9692.eurprd04.prod.outlook.com ([fe80::a2bf:4199:6415:f299]) by AS4PR04MB9692.eurprd04.prod.outlook.com ([fe80::a2bf:4199:6415:f299%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025 10:45:03 +0000 From: Neeraj Sanjay Kale To: marcel@holtmann.org, luiz.dentz@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, amitkumar.karwar@nxp.com, neeraj.sanjaykale@nxp.com, sherry.sun@nxp.com, ziniu.wang_1@nxp.com, johan.korsnes@remarkable.no, kristian.krohn@remarkable.no, manjeet.gupta@nxp.com Subject: [PATCH v4 2/2] Bluetooth: btnxpuart: Add support for set BD address Date: Wed, 15 Jan 2025 16:16:14 +0530 Message-Id: <20250115104614.2381674-2-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250115104614.2381674-1-neeraj.sanjaykale@nxp.com> References: <20250115104614.2381674-1-neeraj.sanjaykale@nxp.com> X-ClientProxiedBy: SI2PR02CA0009.apcprd02.prod.outlook.com (2603:1096:4:194::11) To AS4PR04MB9692.eurprd04.prod.outlook.com (2603:10a6:20b:4fe::20) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR04MB9692:EE_|DU2PR04MB9180:EE_ X-MS-Office365-Filtering-Correlation-Id: 1620ffea-f523-43a1-b61b-08dd3551ab26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|7416014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?IfjgGhm055/dr5Cld3aWfTCUZ/BpRMs?= =?utf-8?q?313W/FZHLX9FAVL6WQCqiMyZpRydkPMpSijMKTeOOt8FtRiakKbi2Z/iguQf4Ci3r?= =?utf-8?q?MiczJWIj6Gm5USoObi2iwovlnM+MoVuysYh/KGpssVgh4WCpa3Tq+jkBZ2IEumC2L?= =?utf-8?q?WcP6F2L5kyUDzk5R+RNSVFvsiOeXAQJA/Il4Ct5iZgEje/55DoNxdPC2f9kxgwufY?= =?utf-8?q?SnhSmqNGk08Vj8v31y/P/Gho20HJiojKIpQQuKj8BBAFyt81b6Bgil5BoBUcQi6AG?= =?utf-8?q?mz+Y/L/vMOYrJJWgV2xzMH35McLUZEVbwkE+b45ySOvbAr06TSDMTBXZEprRpHRD0?= =?utf-8?q?rESt28tGSFnaHOsCt9C3lMztW7mUpo09SNEWsq3qaV8vBUSIBlLEYojojKQcqCP83?= =?utf-8?q?Hn87/8SZpI1gk6tV3xllVM7LI81PdKU/fDH7nqlqZMjQJksw0ArZcobWLPB4MslD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Qhcq91Xz0QcbUm3R4PSn4lIXl3+lRmR6lJiExNntEbA4OJsPQNfsAOBW?= =?utf-8?q?CDhvMHHRchn?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR04MB9692.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(7416014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DxWXlLtSAaMLSKJ2CJH9ZVyL0ANW?= =?utf-8?q?2+v09onh/D+u/pFUkhkYqTJ1R1C0nnnRscXTQqqbIh49tKLr1MDoaDn9ot/If7vK4?= =?utf-8?q?XyiYnPRT126dMTAy/qqS92DA6mYSEZosnVOjr9GeA3zRWmO95awaEo/p8Jn1bUnjR?= =?utf-8?q?P07mfIa/oZc44kM/5keiDBKiXVjrJeK9kuvFjxx8t8D93jPqg0sUOVYApDw05dSp4?= =?utf-8?q?pO1QvBEvLhayMOsXvICcB8Yl+nscYuATG/R2cTRXbz19ztE062oUUn/OYcJOQjZdv?= =?utf-8?q?vabSgzkfBE7Y+MEr3p9jwlQlLPDrqSN2BKySVvBI1K9936QKj4PxIkQTGSGqjiFci?= =?utf-8?q?SP+sDRtSePl6KnUXt29bxBRMt9c1+gZ6EKe1XIEv4ehKgFggLkVxas8gII2ufHDt9?= =?utf-8?q?xzkdDnE2c0YT60/E0kPagl1rBrkGkxjig4f98OUZVS/XtqBNaQF865X4AJE90NkkX?= =?utf-8?q?abxzo9zTrMwn0Hk4HEiJ+hagrRtnQrWt6I+eUa5cyQa4jthtcE0hXtFMaDtfLaFcP?= =?utf-8?q?XQlnBwQFcrGLr4gnf2N3y9vITHJ/UT4BqvoKzZcGI400ATRbK89OhPVWVDLX4uKcb?= =?utf-8?q?O1xmh8yW/9T0hQd+uT7NI/EXoh5NXuL7a+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EVDh6b74Cg7j4j/JgANt6?= =?utf-8?q?qLh71dz/Ge/bY2j7IMxyU018ZxGPdhDCCA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1620ffea-f523-43a1-b61b-08dd3551ab26 X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9692.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 10:45:03.8363 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mwn+xFwaijsrHaB2FOzz0ytKKRlNa5xk4pZmzWJr2QZDcps6dsqVgpP+cvbySFh2TaCCnSRN7HsthIEjLpJQvQLbBY7CwUvNAfzhdOTMZd4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9180 This adds support for setting BD address during hci registration. NXP FW does not allow vendor commands unless it receives a reset command after FW download and initialization done. As a workaround, the .set_bdaddr callback function will first send the HCI reset command, followed by the actual vendor command to set BD address. Signed-off-by: Loic Poulain Signed-off-by: Johan Korsnes Signed-off-by: Kristian Husevåg Krohn Tested-by: Neeraj Sanjay Kale Signed-off-by: Neeraj Sanjay Kale --- v4: hci0 interface shows RAW mode if 'local-bd-address' not defined and HCI_QUIRK_USE_BDADDR_PROPERTY is set. Add Quirk only if device tree property 'local-bd-address' found. (Neeraj) --- drivers/bluetooth/btnxpuart.c | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index 1230045d78a5..f237c0264e0e 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -1197,6 +1197,34 @@ static int nxp_set_ind_reset(struct hci_dev *hdev, void *data) return hci_recv_frame(hdev, skb); } +static int nxp_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) +{ + u8 data[8] = { 0xfe, 0x06, 0, 0, 0, 0, 0, 0 }; + struct sk_buff *skb; + int err; + + memcpy(data + 2, bdaddr, 6); + + skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + bt_dev_err(hdev, "Reset before setting local-bd-addr failed (%ld)", + PTR_ERR(skb)); + return err; + } + kfree_skb(skb); + + skb = __hci_cmd_sync(hdev, 0xfc22, sizeof(data), data, HCI_CMD_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + bt_dev_err(hdev, "Changing device address failed (%d)", err); + return err; + } + kfree_skb(skb); + + return 0; +} + /* NXP protocol */ static int nxp_setup(struct hci_dev *hdev) { @@ -1500,6 +1528,7 @@ static int nxp_serdev_probe(struct serdev_device *serdev) { struct hci_dev *hdev; struct btnxpuart_dev *nxpdev; + bdaddr_t ba; nxpdev = devm_kzalloc(&serdev->dev, sizeof(*nxpdev), GFP_KERNEL); if (!nxpdev) @@ -1547,8 +1576,16 @@ static int nxp_serdev_probe(struct serdev_device *serdev) hdev->send = nxp_enqueue; hdev->hw_error = nxp_hw_err; hdev->shutdown = nxp_shutdown; + hdev->set_bdaddr = nxp_set_bdaddr; + SET_HCIDEV_DEV(hdev, &serdev->dev); + device_property_read_u8_array(&nxpdev->serdev->dev, + "local-bd-address", + (u8 *)&ba, sizeof(ba)); + if (bacmp(&ba, BDADDR_ANY)) + set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); + if (hci_register_dev(hdev) < 0) { dev_err(&serdev->dev, "Can't register HCI device\n"); goto probe_fail;