From patchwork Tue Jan 14 13:35:47 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: 13938778 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2080.outbound.protection.outlook.com [40.107.103.80]) (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 94DCD20F960; Tue, 14 Jan 2025 13:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736861687; cv=fail; b=dugRwmLBLtA2NTxj9F8/PloGOLttiEJGjGLihIqAWlNPybvbnfU9n25Q7gCiUyGO2gP+f/1LrAgZ3mQx9Z2krSeCuDDjAKGMMy6G3kYyi8b+rboCfet1PnfhXMhqm9UB+DAyEjb+DnhdLfDW1pkdl+kAwPbU5FrmvFS7+ADHuXo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736861687; c=relaxed/simple; bh=lOr2ynDC3rVHzudBhL2rzyatyYuBUbWQNL1wZgvPxaI=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=Hoc8znjIjKpM9j4hICEBeeK5wpkUcu5bsgwTD43aQjYPhkmDUtklhR/NLP2FAOoheUoOMX9eVywtsI5qO3pc5rG5J6h9Ll+GuAvM9LLTo/iHQhgHwooJ28cqCSH1Ki6/AtUqARm0J2ZqeJOIkYNIxh8jmpnOh7VH7oCMGlPNEOE= 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=nU+Abs3p; arc=fail smtp.client-ip=40.107.103.80 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="nU+Abs3p" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SDgsIQgIABaxcI1vx5K9Flrhj/mFIPa3FmHQ9TGNX+w4j1qFBHfY8VeuFkmbXVpQfxmjicBnA5rOo9pnHQiw8iEHaTnZS68aKwkJHFkY0MxxiJJCuXYzhmDfZTVZB0pxukTCBLFtbXC3otTuxso4EtdDXyjtTz7F4z6xNsdBZofO1BRonhCzwJL1WPOdwv3Ww+75AZqSNIeBbKuawJecKDqti0Uam8dLquCy8lkKZQgYjN2NjF0Ru/wb2Csffy3AvDwkjQmrZFJnIoz2oT/83wAvBMbIsC1mvW+CdmPKwnLsQt6sBvwMpzTdbMWdtsLhFYo0lIFlyrM2Yw5zHZ7ynQ== 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=z07CRdol8+YWxA0ylPz7VlRfoOx00FZgxis0xuMQPck=; b=boSqHwoaJQRpX2w4eTj4EE0ZQn4NC47GkLbtz427wbUo5olQMy9ItWh+XzCuTXrdhIx6HLut3uygfOfzBRpBso/vXaxa8vAOlAQlvqn3OYTyEuQvrcCWFIjHU581o0DTHzeN2/Xdb/3b7HgiL4ALuJzu/MfIAkMFZfijuAv6SW2iMorOCUwYMRJu/epmWJnF/gMx9firIXpL3aM7/2juDzzcyLIU6l9Vom267lZPny2ez98dx8XXGUNTQuUCPoJc8B+sJvQ5h5CHM+vAQuWtFQjZ2XgUMECQyMrZTJMr34EQ2klLY6aNkXo4VuKgE4HljKrz4BZRDWHyc91utfgDBQ== 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=z07CRdol8+YWxA0ylPz7VlRfoOx00FZgxis0xuMQPck=; b=nU+Abs3pNacIDhNGQqouVbp0Ql4Jb6eHp9xYsVL67s4T+8OsSsnIlFJyYLgs8AbFgNxZGD9cJe7OltHy0PUad6Ioq/BivzngXWASUQAVIYZgYZGPsOsXFu1WvIXzF4xkJu7kbvVXkX8jep5F8oLWa2Bg9j2pdOZSh+VxWhD6oCbuQ+GeU143JfMrNg9xIVT6EAIPRSFXufHUFSDFUTZIrQtcsTi6CKV5qm9TD8WN47RhhCez+Tpi/p4y+fePanorACExHPRzQH0rqwv47fZHmo8QVqd40QN+8n2jQ3zVFZfTtzAOHp+3dqDjRsIfC2XnEwkRhdOQEgxtMdnRVpONyQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9687.eurprd04.prod.outlook.com (2603:10a6:102:270::15) by DB9PR04MB8252.eurprd04.prod.outlook.com (2603:10a6:10:24d::7) 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 13:34:42 +0000 Received: from PA4PR04MB9687.eurprd04.prod.outlook.com ([fe80::742e:a5ac:15f4:116a]) by PA4PR04MB9687.eurprd04.prod.outlook.com ([fe80::742e:a5ac:15f4:116a%5]) with mapi id 15.20.8335.015; Tue, 14 Jan 2025 13:34:42 +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 v2 1/2] dt-bindings: net: bluetooth: nxp: Add support to set BD address Date: Tue, 14 Jan 2025 19:05:47 +0530 Message-Id: <20250114133548.2362038-1-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI1PR02CA0045.apcprd02.prod.outlook.com (2603:1096:4:1f6::16) To DB9PR04MB9676.eurprd04.prod.outlook.com (2603:10a6:10:308::13) 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: PA4PR04MB9687:EE_|DB9PR04MB8252:EE_ X-MS-Office365-Filtering-Correlation-Id: 599534bd-6dfc-4c4a-0852-08dd34a03353 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: QrV8rxLUNBCi5nQWLn97xrshi7n+TARsZadBxClsKTTaLhNJzS72W4GexFw8y/tRX6mfATeJbQySEJyn0q3svtlMQMNo/fUYT4yEmp3byPrsvBQwWqKIjDUiBH++B+rErpDQov8GLxnNuZFZfu21P9ticPvPpwL88dh+COQgcIe0QKzcPBFtpBydbgi9RrbsCdMIasqNK49TZYmYQA0/XaV6nJM3plL/JHKpC/gt0oqUlANs6EeCl/k6A3SuFGYNDKkfZWglE944UIGdaxCoqgKCbcokWjFko96xtmKKSQNfNzUDrWVnIQMKIcXX9h7UgJlYumNCE5j0O5Fm6QTHwRN9wX8YuJ9Y/qP+9y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ARZgqoB7Z0x2kzWnhvaWMj9acqV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR04MB9687.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: cHqAepqUI5k3kMKNoxWcG4qsQqlXz9TcFCBGowUmPY5jbxN8gokzCxfmjoFYsNlbHcvh///sUyixTyKjYuIkUrlUVTNYEFb1C4wRz1TW9UFa0xA/ycMUyESws23R82UQ7ETq3zcoxAcc8eTcufZNtkNs0rOpyrnH9dCdnl0b2J4MKmFooyeG8oXfNB87WYD3zW8kfMUuCa1ADs9PDRTQdYZhe+VbHBDYf9JqSZs5csfVdNyuhMRCJ28a18V7MwPBRN1Dw9Ve8BuNyNQffsf2NFyAJEXR7+6pDhu4/jaz5IyDRcIEjBopdpUKdhwYAJlu+IUaUkDOYG9/D62weLLimbV23ANYFpGxAnc/ELv9D7z5l+zlHQ7zl7B/Hp3htms8h+I+hWCMx3oJffOWZNITM4jAeVlUevYZ/yrzPjA9+0SzENegLRcAdaubk9T+8VEdTag72CngrVXq0j91iZdswbx3zXsTXJmbhh7ZE/RmHUVaeHXN52TGFR1AgUdeO5/S5MLSKz4F0ogCpc6U1QU4sS0YPXpSWXi4jp1Jrx4fRThQCUYTAepBxXZHjM2/9CpgsZ3hysKKM/sBE2Oxz+ASefeB7EI/P6N5Ha+I0CbQL8ApADEfXyTgrv6Af/DCI2QIM3jiVJGW9fGA0INBOE1ZXT8yj5Y6vrydDKTfNeHF4HcT59M/8I1C6V8nCjkPt+IIJbDlw9eva7tcdkPGfPt6KxtpjZb5zNo2LlUJHYav6bRQH4wfV3zgGI6JKd3QqFtTMixNlnwPJVGaWcTV+2w/VVAatIzomUAq1r/MPCVkcYKqHhp/xwckW+UO5smDrWdrAv3u6pJvv7YKktk6FO3i1t8YrCIRUx6BSg8nJ+SPdnueZ09zTBTuSApczxnuCIZ9Ef9vb/liLSk0NETuM0H9dJ3Gu/oVsq4Ydb9Mt5c3oHuLVIEvi4FnfZHRXMbxCfVCoREuVnvXwU4zCgC3PqSKdcKqQK4S1wrTx3im8btcewIJ84yrtq1ydpRvJ7nAgyc5InfduTIgKmQLTVBXlGWC5t7RPe8KT5olbe0P9YFl2Gl9d5lq/girU/lEh3HSrTYoRPsw/1mjOIJqa1czirPBgMRo2HbZr1zRlzw7KQKFWbcKq37bfe9p5pkptCmc0tKCMlxrV8bJ6yfsUHlR3zLp3zptDULtxPli/bdq0tIyQqaaz0Zh8tw/a9iV5fX5tX1uswWt/D1077hZMhKjmGno1AjD79wBKNFUblALi4YElyO4j7Wt0MS2BhIbDsjxOzZlJCLtfFQItfpDEPUyAZ+V2fe9yCwBZlan6oUQjdHEP7B6o3t7vVMCa+3oG8xrErohf+T+gnyMcBKbGDt3hox9/6SHM69XPrOv9GiE3xePPZrXNhTpA9LlTHZc1QAwa1TqB7zBkuKmRG8i8OyX3qJlko3+HExHTBfaqiXKY4bIE3AzGZd5hTqUTNV/10QVZJWwtPekXLbWg3KrLemG6RyLxpSToyxqpLtnbUm3oPZ+PthlCGZnBCQyrho8Q3hv65HdXRJi98j3TCoDKFwB9/UObfIZcnJ45RhllyxrDjSSwguPIlNPopdU9Rq8gDTAnp1emzb5ZhPkvmXmVFhWnc3vgg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 599534bd-6dfc-4c4a-0852-08dd34a03353 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 13:34:42.4058 (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: HLmm5MC4RmYUXRedKaGK1U3XFFRNL6fk89bTccDKA+KzHfe+Nlg6VFHdXjqdWVkVv9JZpGIbux7go5m70XPBXaSNymRCoMxpUV2isDZu9JQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8252 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 --- v2: Add allOf and unevaluatedProperties: false (Krzysztof) --- .../devicetree/bindings/net/bluetooth/nxp,88w8987-bt.yaml | 8 +++++++- 1 file changed, 7 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..5d75a45cac14 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: @@ -40,10 +43,12 @@ 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 -additionalProperties: false +unevaluatedProperties: false examples: - | @@ -54,5 +59,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 13:35:48 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: 13938779 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2041.outbound.protection.outlook.com [40.107.22.41]) (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 4311B236A83; Tue, 14 Jan 2025 13:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736861692; cv=fail; b=lnMhDPW/TUfXcr0+LiwqOhMwEwuxO8iizI+spTg2e60ryLb1MuvpJfx7I44zEhbKkVviufrekj2v6f+Hf9KoXCbt17ebMb2tKmz3+rWta0UW4N/haFd9ST6Jn3UHCud1yOysdNrBvhpDUgBkf1SaE21eMr2rtJw8BPdzWUeE2Qk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736861692; c=relaxed/simple; bh=qEwOgUuNtM3MeGJu+fGRwOdHtEdlmeqDutKE/H3W7xM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HQOkBkI01ocgygb2eemV1hoORl5jcqKKon4jJdtDPrc1obxB77H75nplOVeJwXdkdkGnas19BbT0YTZpbJdyZf4FwNGI1XTvYvQASSFmawQEoz/Cmrj5jGC3I1dh4Y2aFmw3rMWBmFE+CLpSg2NJJhc/rFGbOb08JjAFbtl4Fj4= 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=f1ng9elr; arc=fail smtp.client-ip=40.107.22.41 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="f1ng9elr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sMmH7s75luVGkWtlGUVaaVyF5Np5B76zLV3Tl7V0fkYFMfjWQaNVM7Mr7VTaAGIXzdDggjMH3bBOJQz87dMD5V974KHpFGcXdhBvRh1mxscYRCBz/OuOUA/dIve0YQ1SXrx9mZKWiCqQrrtITneVWXo4DUsOrHZXL3O+ANM3c9QtAvU8X3f9i5vc9aYF5mg0fl0a6O6m+DoUzSR/b2q41Ce0/gdUb26XJY9Nc+dfj+V3XgZzNJ36naQYjYbkyRMgeAqSbQxqpyMFClhiQILp5n+s437hMcKf4101lZXYj6y2Hs+nIGGPkzXQLXYQm/PikJ+ajJXpHgPJvr43X7b/Qw== 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=jFR0YMgkrwF2uaFKuS0OC3Iy1LiQcJOZ6xR6TCGx/dmPM2zTcyirkuBak49Hqj9nltQfxwtueFtpIxVF+IMXu7/PGohiwYvbmc2nvP4Irp9SaXNxNA1mTFhMPJgFLNXQLfnUXOzWEJgWRb6MszIA/8oGvh1BUNWjIi+0P5jpRbDuiY3aYQoAP467zUwxQ9tHnGvjsRNag+Af/aGfl6vzPqzJJRArTpdYfcKt48lbwDF3bXkLODaY+Z/WosDbXvDzdG4vj4c301JmXZ/GaiINV96knxiRzl74lEmyI27p4r8BH+IfcwRs8ET4fBcOF3JpTR4HN5//4V28n4O4JI75qw== 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=f1ng9elrHyB+nUnGApzTYb/4lAyX0IzsHzx7j1vOtqPjG2xMH1vv/pZ+3gT3Ji7yZ60KAPK/68W7902LzD1Uhu7Z8v47veQTf/1asChepsFxl6n79u63CgnwIrW5cbNWZ++G/VN9jh3ZJKQKySkH0ewyZmHrfgwgEIVROQrEzLKlo0iUxfcTMaL0Uo+1DMoiNUOlg0sZau/jTajfZpJjkGHIyGSzC3WIc5vQkGlKq/GGCdr/DJj/BUY0hwDN04n2Z2ulbXYhUCsDnI426zTKD36ozp6LDeqv7xxnmGiEtHYh3iHy3dBkNgIadaOhKrql27ZPp9BLE+1Ib0uDXTGAWg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA4PR04MB9687.eurprd04.prod.outlook.com (2603:10a6:102:270::15) by DB9PR04MB8267.eurprd04.prod.outlook.com (2603:10a6:10:24b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.19; Tue, 14 Jan 2025 13:34:47 +0000 Received: from PA4PR04MB9687.eurprd04.prod.outlook.com ([fe80::742e:a5ac:15f4:116a]) by PA4PR04MB9687.eurprd04.prod.outlook.com ([fe80::742e:a5ac:15f4:116a%5]) with mapi id 15.20.8335.015; Tue, 14 Jan 2025 13:34:47 +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 v2 2/2] Bluetooth: btnxpuart: Add support for set BD address Date: Tue, 14 Jan 2025 19:05:48 +0530 Message-Id: <20250114133548.2362038-2-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250114133548.2362038-1-neeraj.sanjaykale@nxp.com> References: <20250114133548.2362038-1-neeraj.sanjaykale@nxp.com> X-ClientProxiedBy: SI1PR02CA0045.apcprd02.prod.outlook.com (2603:1096:4:1f6::16) To DB9PR04MB9676.eurprd04.prod.outlook.com (2603:10a6:10:308::13) 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: PA4PR04MB9687:EE_|DB9PR04MB8267:EE_ X-MS-Office365-Filtering-Correlation-Id: aaaed26f-7756-40f0-95cd-08dd34a03688 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?d199+01F04WM8sd+xnRcNGJA2vqHlEs?= =?utf-8?q?vq91r/hg0/eL8nv3H6T0ZjwcId8RuAclVOg/PngeYBo6mUdZT9qHOHndqunr/aAc2?= =?utf-8?q?V9VsAaA2BjHMUyRw4CFB0uTcfbYOBobtRRWqzzk9TftiNzBE4iWKSI7EqOiVrNA5A?= =?utf-8?q?ThftTFpRQthK2gslKueimfvevYu2b714+fOwL+3mKCcVvOn4iO/Ks9fgdndHyqW9m?= =?utf-8?q?AmWmmVRpiAC4bnmSffsY9oOifAl+JUVAIB8wRzRKA5xEff3LYbRt4EmA0CTJNMfXb?= =?utf-8?q?1sSfkFv4Yq78Z7TwO3HnXy+2QSwCSvFsvYIASuaMcIMG5+KF1QHXRKu7oMuxuFH7S?= =?utf-8?q?Cz2F1vIWGOEhFjl26lw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y7YNGc8pcam/5Y58q3f0SYJ3ocB59CvXxlh7FOvPwIdWzWl?= =?utf-8?q?irDk/IJly0moLpd2VhkQGjKnrPKGhxoWJMT2606A83NiQXHEtN+djYuaH8KckQyp7?= =?utf-8?q?dxOJD5s7F64CKui8uYnOh6CojwdSHPIrW8FzGMEX91KcYhXxbn+5MJBcbhXYrjGML?= =?utf-8?q?N5tY7L16z6D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR04MB9687.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?tQeWaYEtlrBrBUJWHIdB0P5xRsJt?= =?utf-8?q?ZXiSR+BAzDaaJosObL6kww+nEQLtSQiYUpn5TLvvuqzUFKFCzZwhx7h2d48/ermEp?= =?utf-8?q?tMxFxpZVT4ZNLQqTWsC0z/ijr8JxKZ98X2AyrnsqgWvFTIa4GxLOR6DL3MmZUn3rl?= =?utf-8?q?4D1iVkUD9BmhdkUX34cd69ff38iJTFWGicaiWXknL1bzw4/hQh1lmPxFHvZMNtpxe?= =?utf-8?q?npjecvK9r2gaRkkfdPgISRA4PLUtYtT0l5wz3jf2fNalJNJbESK9o1GHJpZUpj5OA?= =?utf-8?q?9Ax9lQuIH8GhbJlmFb+giWffRzkU3JwAmGQXMVgc2QRthcDlkJr/36CP6RjT57Iwr?= =?utf-8?q?2lDezUy3xXUZMQvKmMvkXK3R3vGm4e0ain+tWT2AaIY/nsL+ZncAwxI4hkbL8ZtyY?= =?utf-8?q?7/ktbIzQccmvSXvHMbWGbRdNOnyRpGCZQinSPyZjNlhiov0YOY5mW0bPMhus1ZXSv?= =?utf-8?q?x4d+AovBktnufcBrNp5zvZg5Oxs4OekUKtVkkXUBd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/oMZMpozVaBEZADQ4Alm9qxrZTk91?= =?utf-8?q?G2soWSl73+Cx8tmPV1QSvoGpYpYZuBMco3+ZtVAVYwyL8PPSQEWeJ1etcIk/VS61k?= =?utf-8?q?WFUqeYF4iv/jXARXD87DYkjGfF9zcU30P0wbwXR6yw54BMImWIk4Deutt2O1H/vvW?= =?utf-8?q?8Ecs4A37xZH5pcLY4uiWU9/PuOco6emAzQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaaed26f-7756-40f0-95cd-08dd34a03688 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 13:34:47.5160 (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: g3a9SSmev3iIeY36DcYtAGioG2Jma2Ah06946jdKO8PnulMMHyufgjCi4uJy7ISC9Wystn3fzBA1X1g98Nntl6kg2Q/1XlOyf8yIOeCl1LI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8267 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;