From patchwork Tue Jan 14 10:40:32 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: 13938604 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2079.outbound.protection.outlook.com [40.107.103.79]) (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 C412322960F; Tue, 14 Jan 2025 10:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736851180; cv=fail; b=As5YA0HaE7rIIjSQke1Ozc1AsndG2DDjDFENXK4F0KdkausjznQoZw5eIkgDurubTrOAszZdfncVxFx0Wd6qgnez9GVrxyG8XO5xCpa9+SB1ioJjCjZNKGTNHHMq/U4pOF1Dkv+/If5uyZNQkyfBGF3fgR0u9AgUF2MORxIkPKM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736851180; c=relaxed/simple; bh=UQ0FaUMyXuG40irhvZaCghudS5tNONtkGdr4OynJ3ts=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=rIlIKzA5IUIOmmP4sH8oMe3sGkIj+M4/89jaJ6CQ9MmQqzDJ++yTijVbjiQ2vtAQSu7MzbfhMgeGp00OPwD2Ek+W5abhCHeZt0lY6/hCCFWFWDwwt1GpEMhR/cUIN3X4MPdxs1sIk7HohP460knxny70izF8L5qdaC2//hk7tGE= 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=F6T9pSDc; arc=fail smtp.client-ip=40.107.103.79 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="F6T9pSDc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tUsl3+v12l7SpTsQmGeTdNa1ppee79I3UCRcBkhCZ32et4+X/Me+R1imckbCaYKAW8TRTbCZYWpjYFKDjSSEZMUdUVkR8TD3vrnOz1rxXiDhD8zRDcn0Gc6nus9aiXaZoto6Iar2qODPrPFI0TVlC4oNpxj96jAnXS8v1DIyITJcmigpISTF4v2CUQpEyPRiwKzMRy0hF1js8lMYoUOIf8uTjeJetIG4qS4Mhk7dnPDWR9vkNEzXfx1pOoB8VnivH6UAigJc8w3OZvd50UsAAnHReHtZQ5baUj/NWZ5KY35IirrymWsvcIT8Hxv6jjWka0qhWvO9bWm9WZ/pm0xBwA== 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=AO3eyccSHUsJp3mIaTWIQXc5Vj2Ix/okFK3QKKDfhn8=; b=t/eWgs9EhbEUIBUAnMm4HHHbsSJcM5trWkssFixxXFzMjSke7wo25DyJH+57SNACeqLPA6xJgi/G+/dIjxiFSOkRurv5ORwjHQoH3f+L6t0PzZ4/YH2+uP5Q8mg1RIf92MHvhejXswMKRetDzli2vGToUDNRoTkWRzc9teU4dslmicimv22kJg/pVMT9pmiQy7mouUKOH5wuzfZsLm05XxAbqZenH4Oi3dgKry/0CbrN9YnvhOfWJfVJOlvNFB6rms2iSlEzuxyuisDEA6YCu1HmMqrSiVZc7TDVP5q0o+rDWQp76Lx/LejrtgtKWsae34nFn84wRLVqIQps4Hmxrw== 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=AO3eyccSHUsJp3mIaTWIQXc5Vj2Ix/okFK3QKKDfhn8=; b=F6T9pSDcDx9A940Dkjk+vdkFePS1dTy3zVbncel4w4h+9AnjoQTcTOAwEHGK6gFm4+xr5RehTP3zJlZ2vFi20AiJvt8cBkyIV+xjqLnY/tHLNcmQ7clRQEZuc/ocgdDfVlj/5NBkomSg6B/8rTwan+fqcIIA1cJALO17iznBXJp0/Q1AEZnUTNjlSC+z4oLCyiVAwV81H8XLqM9TsYqqdMmOjuszXkOTLmr+2lk5CIIqlvv+LQWqL/ONG+DK0chN6r9AO+ZYn5prcGFsrOb36Z6lCKQUy3DGyaHrI87AbtUhEOVF9ohDIZEj5QzxGtMs8hRvlxmcnfIcg3Ho6mySgQ== 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 GV1PR04MB10377.eurprd04.prod.outlook.com (2603:10a6:150:1d1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan 2025 10:39:34 +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.8335.015; Tue, 14 Jan 2025 10:39:34 +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 v1 1/2] dt-bindings: net: bluetooth: nxp: Add support to set BD address Date: Tue, 14 Jan 2025 16:10:32 +0530 Message-Id: <20250114104033.2324297-1-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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_|GV1PR04MB10377:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c4645d0-1040-4d7f-14ec-08dd3487bc0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|1800799024|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: jvCnlm2YI+ZpesrUZopDL53rcsxsCmMsBlB4Ibfhg2Ztct5zSruJyfNIXaocYi6nPhZ4iODk5L6JC231rT8RMEdnxRbAsQf4kioz/+BGuM84OCTmqOse2DmxBDhg22i0Ofuy8wM5Q57eqzH0xTQkrR4UexBswtl0Z4th98AjzWLmEz+MaN1PR+dtt3aGCuvVJoBJioM01KdLpzAsFHRJHt+Gjkha/S76gSL/l9mMTQmgWSPr1g7Kh0zpDcwbKUtKCV9CEuidv6+8vEjAnUIhkUsLym1guhiND8ATB5JyAvhzAoV/tnADXmxLmoq1tWKJG5GGOOCO72oOOSHVVwGR6UdQ4HPdnAt9cfb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DAzGz0GBWLqoX/s7t7PauLdv4Awj 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)(7416014)(52116014)(1800799024)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KPyu+IZBUn7GnoLLNkfwQUvckHEn5ZaVarmvgnSqc6c7I2aaAWXvWP/yx127HdDgN/pfZI6eDckP+FYkJxJuBMAUP8upV1zGqEzAuF5ii7N6zoB3Fc6lGam5CyrT9KFX1vm53KEq1j3GYKgtaECWfuSZ1JuzMCRriWV2OFwQFiG7Mmr1GgonzkiSvN/pf2uW1nOdWDxZrn/hXLb/XH89Nw1ufLA7taTeaGXtVJ8vVah1HlIcdQwakLccsjdX7lRCqfXWPjLA88rltyGthAkvoa1lhcSYJFXx+eqMAYjxTJXs68BDYrXYxaTOYicAWujs1dK+avvfhfkLjUaBaxHKwF6KJqeB0lhsIG3ZWgqxvvDj4yp7vnYvDxMYOe4dyd3dWPI1Xm/kobCBRcPXtR+jQWjUVESoFMqiycoJ958ehWbBPaYvOnOQPfpuD35NleDKdkMNJ35cGu80IBMSTeTuG2m3JP0jevM71Py0T3/YZOH46a5nVp0CntOXGMPoGDT1ZBZnoHiNs60WRkAL0rsuIayevKEKGXF5sOfIfaiB/WtyPF2wPWWOamgsGu3b1jGvDXNcilKKaSJIsXJPyalP5mebvx4/22U1fTJ1WA66thQm+CwDD63bNcrgHgHqHR8FLkGnvby6Ui0e+pkM9cZ4Loq6jO3QG2Pm38/rAWoIKxF1rcgkFHNyLZokAtiGhi/MD6jmXMgYHtzeIVNyb6yq9F6aqra/ezt6mxy4LqzV1mKkszl47Y9zQN4Kth6Fq1GHQ/NxasZ3vrPOX0pNR1xxBuf8Qhu4fJsbwe1t2zx1E+OyMPEvYapx46rKIGQQMVQP6qf+LqtD5RZ87dA6XW7D4yIttJl4OllZiica/WeSQWPwivNQWPD/jVUWdbOZaamM5MD9dqgdmJj5NAHDmPqUEOllWiNppCNR87FgpSWa32u441uRQj3O9iy7hpPZDxRAggWhsNgLl4OZyPvFB4d91LCNpIqe/lifW8eNDLog5vnxc9vYXXV8eAdFiLd7XH4n8vGYEXaNRgEW4VRudEkuUp4bnV+CVNw03t29HutjWN5dB1onIZouAh6CSBM1Zikc0RYj4N0CffBap1FiG2jGvLrCoiGg9IuZLe10IllCRtuD0+TJLLAwN4v3b0NjOVxOMp+MeWIbVWvxB1djCjnwG7fUGBOg1PWRMZLQvwwdAr8/9hgxmhTdSzDiKMY1W90SZ0SDFkk48lLGy9DpKnc9SUHX9G+379hFrxkLpRoZGUeVvqXlpuTcgLuVMV9lfTwgyzbTag3BsPP8R3rdHYPKy2PKb6FSrcPN28hQMeu+IPjCNWfTUL6Wt+A6uu90ZVfNzJVGrJEuZfrIhqNELOs6urT4l/j/8t0J3CyweQJxTM7VkKRsI2w1k3Uvu4diGzSnDAURwqc+8xWeoLShCc02hlvhE/6yXk1wPnDS9EEw5rVCF5MUkdHY/HgDqG8JU8o2k/ITUntiFzQLabn7Fu/SWOh7IQAkyQbVZ8vfUy9WTXcgW/St6mo/q7/Dcxf+yrXwtvjhVmTdfU6kFzJ9a4htxmSrPc2VQM9ffVxj+xhxYvpcQE2mqhvax/yXOimFtfZG/H9ATVqGwH3tPzvgvQibiw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c4645d0-1040-4d7f-14ec-08dd3487bc0e X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9692.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 10:39:34.0115 (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: 9xa3Ts3uTnMrMICHFpRo+Je1eiMTnNF8sl9h5ZobpbNvuT1wNq2qQLq+0ZK0RMd+Xarmk6tQMDTmQkixmieednu2h7YCSXHFGR3jmlltthk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10377 This adds a new optional device tree property local-bd-address to allow user to set custom BD address for NXP chipsets. Signed-off-by: Neeraj Sanjay Kale --- .../devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml index 0a2d7baf5db3..beae21c3758a 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml @@ -40,6 +40,8 @@ properties: Host-To-Chip power save mechanism is driven by this GPIO connected to BT_WAKE_IN pin of the NXP chipset. + local-bd-address: true + required: - compatible @@ -54,5 +56,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 Tue Jan 14 10:40:33 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: 13938605 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) (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 5A7CF1C4617; Tue, 14 Jan 2025 10:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736851186; cv=fail; b=jknZ0bxMortCw4j9jzDxxaQZ3UMBPJhSbARJoHI9syHeuFeVbst9968qaB3IG8lX82baCJrzsjjNTR7FjliitYiyajfpMUz5YYCtJz67Tt0wO9EY85tsutK8TydgoT2x/QoPFYvtc569uKyfC6RFPvdEKwGgk2mZ502sWRdQ0OU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736851186; c=relaxed/simple; bh=qEwOgUuNtM3MeGJu+fGRwOdHtEdlmeqDutKE/H3W7xM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=jC1BrVBslMSiEhwAFx/R8vJKiQVrhrTR3bhzIK9k5ROcEs2365hdf59SJ6vK3EiC3nMv6XPOB0yjoZ1nUi/QgfYG/Vd7Y7cEPxk6y1sWsMq0F3Z+FhH3+NLZdiL6EMmtKy/D9Uh36LXhgmG1KyeGekH+Jl+ISDBHM/N5pb8QF4Q= 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=lGeb8pB/; arc=fail smtp.client-ip=40.107.22.58 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="lGeb8pB/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eZuIgKvid6oP8UV2fQi8tmsnpN1aAUnAZlCLbAKk5n1yabie/FjEyxxfRwnLcPB493Z4EX1e0axFVfi4Hp1TTa0QEcztNryVSNPbBO3+XKWcp3rA1kO5X6hLqFY983xer/inzz9kD48PGhqWqOcvbZ1Wi2Z0FMl+BKzL+c0LE0UbjQZlPlpemAcFRNZnlAptkTuNkQ0r3TtctuuMrwzQqqw8YvqENS85fcn24a7GrCrMFk+Ns3raD2BdW1AA+gBGL6pNY6bUJ86QWChK6WidAkMn/LnnmPpDTrJ+T3k6lX7x9TqvZdsTGqfeHjQkZo04h+7ztY5dJjfSSyblkJEd2g== 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=J3GfMA54z6RQBfAsc5L3IwjxdztoEiO/a87y148hXfw=; b=Yu99x3fE4UCpgsjdLoYtAh0CmF0AHS2e7stezN6WmOyRgEgLq0oPZO4VRRuJy192wEjOnjNYLGxskMXNNYktaiuS85HrZ6L+ou2LX55nsvY4ZY+z0uCcBEmOQmdpC420s+lbPPPG0dX+9wXRGAiZWJ0+Mcmzfg0xhMkV7PufQpL/8gJe8aphJ9EF9YdIuPOny7wgeFPtIM/NZyNgJstclFilt5hrZQkmNN2agU+aMeodELAJUqN4m3YiwxJoT0Y+uTLVoihhZaSDrXDVPenojjnyZsJCsGqAxgYFF5tOwJErze+zqwb0AchrRZJCmYtsLKbDIczIe+0EUNMvC1HEFQ== 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=J3GfMA54z6RQBfAsc5L3IwjxdztoEiO/a87y148hXfw=; b=lGeb8pB/E/g9+1Q1CZeJ+TVTm7u+oSveqsugWR2WDTrzWV4dVQXR1uifS4/zc069qSKuHSLqlT1prTSTWruAOlqhh3VV7ftrnwckMc5/QA00ES0atOPHRpz7uKg1wNscBpxIH+89BvZdVCRP6/KW0Ji6JMufJDCGGetrLA8tmwK7779Uu2oiAuowIHerkjKlpB3uKaeUUyNzdGZATdf1X3K9f72+6/YPIJ1OmrtkGDLrAzNUHmZrQTrI0lJPAdXUPsQ+E5K5VFsV/Lqy4GnGKb0PvVKNM4dRRDA7VxXPm7KpJXUseUtRo1vc7+ZGeDmoD5ynYis+QSTbZxL1YUkAZw== 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 GV1PR04MB10377.eurprd04.prod.outlook.com (2603:10a6:150:1d1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan 2025 10:39:41 +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.8335.015; Tue, 14 Jan 2025 10:39:41 +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 v1 2/2] Bluetooth: btnxpuart: Add support for set BD address Date: Tue, 14 Jan 2025 16:10:33 +0530 Message-Id: <20250114104033.2324297-2-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250114104033.2324297-1-neeraj.sanjaykale@nxp.com> References: <20250114104033.2324297-1-neeraj.sanjaykale@nxp.com> X-ClientProxiedBy: SGXP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::20) 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_|GV1PR04MB10377:EE_ X-MS-Office365-Filtering-Correlation-Id: 44ff5e1f-694a-4d25-f26b-08dd3487c0a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|1800799024|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?tr6bcMcvw+wFtY7DAsgL1YhQjZugaHq?= =?utf-8?q?tbNUgTuKYTTZDX/MrYNlHgBQ+HdwNtnPADHYc0ZJ8s/X16AOBc/6VIaMTJGkoNBkq?= =?utf-8?q?86OTJRmBP4ZzzyHuB3YAvs7XsMmV6IvD80DmCwTHMe9gDgR6hhUNqk94ZfBdbqR4h?= =?utf-8?q?IGbZ2sHN+C/uuIVjypZXdjgWIUepSWrGcGRqxAk2X38xmzDvI9PKaAVFnaUSPb9Ek?= =?utf-8?q?+q4WBQ2FVoSxys/obIBT5SiJ7qxxEonoRmNXnNsLN/rrxd4qNQsDT/hykRcUy3Jac?= =?utf-8?q?iQxpb7Tq07J7axrjTKhXNfx8AsMRWbPGzpcTlop6c7QXKDMFZ+iWnlttGWVQyqfsi?= =?utf-8?q?hoZe9ocwNxtLzfrlcK0tAJoGO3lVb0SXarOcnyJkNx95bZQuaLvJjQ9PtY8piiNxJ?= =?utf-8?q?UOUt6/aRaTZ5gG2VEMpuppRpUJ/n1tN6SwOvP+a1WxYUF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FxKuVzvi+x5t7UN6ePZ5e?= =?utf-8?q?Sm9D+DRAdvdRkRKj/4aXVKKJVUI5M3z6X1UWAOliqaYgM2+EJC6lKEIN3FKegWJxp?= =?utf-8?q?yVJBJ1MU7+F?= 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)(7416014)(52116014)(1800799024)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IZFEX/TdQgmRhdVmNaNV7w39Mu0c?= =?utf-8?q?pMZCf7SyetEKfmjiO+Gw0633A4E5KFTm5ET/VJr9zq5RwwJZmh5Z1oKFHPJqZRWed?= =?utf-8?q?Ydt2KEx+DAh6BTzEMSlTlICtc1OB0EJ7iNHYVkgteqO4X0zEbpF+5SN8M9oXOY1T5?= =?utf-8?q?Qxfn4r5OID3TyXYPvrgYuSNvLi8UhzlN8B7VNY1gr74hebPA87nFyfhKt02BkHAip?= =?utf-8?q?vsseYr2Myfn/jYCEQ1X3680L5w42Jdy1TbQY9nSQl1bOaH2UApQ0BfzW9haR0MO/M?= =?utf-8?q?EijYKuHah4SqTM+tla3BjdN1W3ZNIAqHa855Aw5wH2uXlupmcVNB6vZbVD1ThzOvn?= =?utf-8?q?OHPUAqtVbwppeNYftIrEcTu0iu6dangNHqwnSj+bL+XQ10WyVHtmxRR+Mxlq1dJgk?= =?utf-8?q?WMizw4byHep8/An9jdwEnq4Fu0TKf77I5vXSt287L27uYlv+Qppt4tsndsA34PXKH?= =?utf-8?q?RsYy56sKau/EmzqSF5pTXrUfa1M7Edq9VxrUDgc4IUyNYHDkxViYRauadBJdD4F8V?= =?utf-8?q?hcZAcYXslUTJ3nROfufB+06wRq+6wH4zWp9rEBbb5YoQuCd14VHG4Nmlwae36EGM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Vsw6?= =?utf-8?q?n/tNiWOC03MCXF/71WOuYya1mw3I0wdJpHthhJ/br5rmUI+zQfpehVDX68BhW7zDT?= =?utf-8?q?JHVjpPBMUYNBmAWEvNq9CuvswOOY29hjgQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44ff5e1f-694a-4d25-f26b-08dd3487c0a0 X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9692.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 10:39:41.5221 (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: k+fKvV+NLizMWgcvybjB1X42Q6cuptq0iOpemcBGZ8N8+57aotzdpAA7pqSIZh888LLGwQF9np01vjcsIJHNaVzPUpsnwgdZd2zD76C0MVw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10377 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 --- drivers/bluetooth/btnxpuart.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index 1230045d78a5..deb546a4e664 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) { @@ -1547,8 +1575,12 @@ 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); + 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;