From patchwork Wed Jan 15 16:38:45 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: 13940645 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2054.outbound.protection.outlook.com [40.107.104.54]) (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 A7A01142903; Wed, 15 Jan 2025 16:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736959058; cv=fail; b=uhd10XaKfKx6gc58b0tLS3brEgjiATl7RcbPIzGG/SblQneoRsG00DhpwwDlNMCdy9n14o4FeKcR8iYVzRhO6gWzZSywV46J3LmjhiFsPrFyxVCTKlOtLXN9XIFJc+oPq0AF+902jM3Vj9LBSx+sWi9TpHd98qIAeD3f4//AAhI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736959058; c=relaxed/simple; bh=QKilRpM1GOK0/1eazCteUzILU5562UmYG8xApcNXkRQ=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=uugwNZHEf2+DNFTr9KiiZt2i1bVBXF37vN+FbQ4jGmLllmmO0GVXEhjORLt3h46vRLX1/NvCfxp66vqIzCeS6tIbIq8CJL3pvgxtQIc3xfzwBqXgZeZokZCkT/kO7+2kqFfQFaUR/9tYSMpuV2VGlzKHlNJwM2NSUPGptxA0Kt4= 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=PTFvs+Nb; arc=fail smtp.client-ip=40.107.104.54 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="PTFvs+Nb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qN88JaoTTXYsOpJv1iGdK5+GhY61//RpDT9S0sEB9FV1L1dPEZFYki365IKTLoD8OmfCVzM4TwHLdLwIr8wDI+uajnnwEB6MvdahrBsTWcrwCdwTc2cysGH+XX+oYdoH8nTKhGvGJoyadDm0I1gR/MYmKE8EtsByssSr033QbJENIpAV9Cie0Z/fhJ9pD7HyANnoNLzbZkArN7eIR1ZQIuJKTi8UbQSHybecu9kFLPgf1KZXghhIPa3q01UQl/MaRJ9QM6g0g0SU2rfqotmeov0Lu7V1xVDA/OnJQpLv0DtqhIL7swmh8pOckNgirfGaae/NqVKcDKf2oThTMeGsIg== 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=238kcuI9VnEgk+SX0WJmEK10qL4LdeTDe5BiGl/SIVU=; b=onBzmOQW17tzDIhJ6u9JDf0jhMP1xovKnz+wk2DALndpXm7dySHIMBY26bACB4lFd2Mx2VCvkmnpteq7jSOhyeEPBGuH9beUg/F1woxJPm5ZdR7is0X7T2egUxefoHKkGgLkH9EDVlgg6ZwFJ4K6awr5NO6GbWCb4OPXC41llVUrfqCRNOUWA+1PNbs6ZZV5/35Aw0lDZ3bb2QNvS3qPEbdjl8NyA3G8sK2XJpzZe0wGH56p6KR5KxgIzTs8GsNYlrpktj3SGvjwUNX8NSC59eSYmGA5tz2xVLZcGaiSAe/TqwTAZEQWOKcp4bEVuNpxh+rnZDNz6Gism8Fl7d2wlA== 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=238kcuI9VnEgk+SX0WJmEK10qL4LdeTDe5BiGl/SIVU=; b=PTFvs+NbFlNiZsEjbaluSa/CXoaK+TKUizbqY8r1coIBQaWBHLB7VjivfGDf+kb3m2VzKFNjK349kgIwL7HWeBnK+t9SuxyA7ApK5vIF9rhm4xx5iXtifNLGAE6t4eWRn7Wzj8ndwa1n8pdUewpcK6oLkg4FfX+ZeUbGHbNjYzidIOJPXLdnvfc/M45TsSgctgH/979rkCLPG12q6pK6+UOAST6mO1+63bhTKvOBjwIalNWsGhD5UZ42909Ly9Ed/yT96GZ/LysXmAsqNDm+5aIJ29C2t8HVThK8p4xbyFUYLTUm0MzfVa0nZu2i+FKhNc5vnKfSrYPOv+QVJ4/JLA== 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 AS8PR04MB9079.eurprd04.prod.outlook.com (2603:10a6:20b:446::12) 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 16:37: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.8356.010; Wed, 15 Jan 2025 16:37:33 +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 v5 1/2] dt-bindings: net: bluetooth: nxp: Add support to set BD address Date: Wed, 15 Jan 2025 22:08:45 +0530 Message-Id: <20250115163846.2385345-1-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SI2P153CA0010.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::13) 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_|AS8PR04MB9079:EE_ X-MS-Office365-Filtering-Correlation-Id: d163e9a0-2be4-4b15-a101-08dd3582e97a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: teTYrPQT4toBf4JLmCHLdTuUFIZaORi7+ZOWYieiSpmvAN68edaotJMbvsNECjXoX2aOiOAYhmPyHVuQugqRKkf50LvIXXPZ8wGujxjtrZV5InLxvCKfP6wOizDeK5tbM9i7TzyTXe5xkDMzmHVeOIxqlKQwaRrXYYCCFlKkhRXHIHrSTIJQ72HJIj++WF4uWHslEkZXzqcCpCTLPkJLWkpWpJ+nK6UV3T5XtOqEDCMKXBfJYuZRo17RofM1dFgPMaJLxcXZWbt/541PXiY4wa8c0lFHBS46mLDdhTceCccxgemGcYaMKxZmEKNMJ6bHUKyhU891rkSZnIx93RMBuYX3QEQCxp7VfYnEUsgnoLjXrd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UJZOii45RBrNRnUld7ka 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)(1800799024)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T8G3pvReBoiJyznq3Bl2kV7Wz62K5nggf8b0hLtBFKk2bJ+Vl/VzpeoW6ZgEUS64mePrZsj4KwX6OWlm7fiw3uw/YfYk0Djptaf/A7LR0CinYEnuh8OnYtT99w+8aUND4R10T001mQPRs9KbTiBOBPefyF1lszhfRh66MCrN9QmA0Q6L7meXmMa4q2vxPkWqWDWWcSC5ZoU0c3vu9YAYKDk53hvXDrrAcwf+RY/h+ktYsQdu/GuLfrXsQO06tAnwgiaY0iQt52BT9qo6nE/KtA77W3XHJZtTKY/cExN2QN5q429N1oITR4oyz5HfHqKhzGl83BM5EPbPoiI18PV1X2hAH+bnNnbILbSRNyCIbrfmA7ZJLhYPAmiOUHz+q2zzg/uuEJaYdpqpLrMmfL4HAS8lTsgNbbi7cce1wiuLLQmi9DNJC58Hd9MHyFdhJ7IEkm9pVF/67QIiLeEBNirZh/jSxBV0c+OtkAJbD1ngMVEapNVjSuVW5BbNcln3czxT4JRbCYdGXWgxKdD2/6z7oGrMgtAhI2prihI84jCmJL7/DXIoNiSQY+fQzsMRrhm6GvLAE/MTMR9TdW2K4Ho4hAQQdkl2/Rqns+NYsmHNiXEkS548adr5dxGyIVeLtZBEsWcLTWU3UEtXzH2M4w7ugfVlNpo1FcMlZ724JFqofkgwAg0VVAp1KY+uChMkY+HnHcdnYgcUA9fwc5+u49e81RxlvFDubeDF5WsBg8NMmw9qxIxwPKWzxeoMCsOOWHhL21TCiEJx/XPkhqRLJIHU5cNjYU4hw0tlcatdD4P4qPgsAUrSjBBAkj4uywZbIe55EOe8SKZ259rL3aovrVybUdBjHnFWOhH4wtgQZwL6L2NNeblrA4GUuZl7tRwimyHYP0lZ7U1MpUqINNKn+gifaDol9pIk6Toaaw0yohLgIqGQE0bSKL6jwSxu29f7KhjlJanPq8/JquP9558fdHZ9qLeRINQgIhCgM7lxGq4XrReWs/UZCgFvsTLqG+DRvnnsD/IIC88OFCz41lH6F6BAhyMwSmSyLErsX6PGGqXEsy0hWLQxhf7OEFkcBFaSnOyzBzPNYgHo5g2obDVMi7MbW2pMRLypyejR+5x4YyADVYEG6Fw7v703GLNraVuMkALZWDZ8Fo0luNnEINGPZroPE4kQRJN6QBwiom60LtYJepUqx2CmlNs5TL5fvkIwgGFALwwQyq6CtpFgKHpLAIXvi9OKNzHfnwGoJIWXc4fwC9uDYm0nk3H+klVFRthi1gPFphFUyYiLjersV0ZnMhsHf+XiPhDsqFgCcJdclNiivhRmm/F6s6TP5hLVMmgoP/W302WxGmEYGyFUtvtmWRVN2sEr0a88mX3dJTtWEoD3ZkHRUSOc3t36rpsZBwOodgrN/OnU8Q5FKUfYZiWbkfEoK1X/wSD8XoTW3bF5CAfeMQJR76t8fgzU0dHhKYwXg7XXvVWDBIGW/UklRaz0hr21D3zqn0Erllj9xUXYtp/MxmS45tBL7aupLNQYW+GyFznDODqEUm+X5yywdQSNwsAPvnvCQ7Y+XLHX37ubI+DKuhgiWXWtR6bpVcNAguewIMkTnZbOU3e4EjWZoyLCJ3V0NQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d163e9a0-2be4-4b15-a101-08dd3582e97a X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9692.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 16:37:33.8657 (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: qH9f10DRGQusisi4dX9qJSTpoZ10kjs4JhwsCscNKysLLSWoKrxkO5JEVq2Pa0KMxoD0xyzeH/crUeTKPUQRaLMBPiAJOel+j/76R0770L0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9079 Allow user to set custom BD address for NXP chipsets. Signed-off-by: Neeraj Sanjay Kale Reviewed-by: Krzysztof Kozlowski --- v2: Add allOf and unevaluatedProperties: false (Krzysztof) v3: Drop local-bd-address: true (Krzysztof) --- .../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..a84c1c21b024 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 = [66 55 44 33 22 11]; }; }; From patchwork Wed Jan 15 16:38:46 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: 13940646 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2068.outbound.protection.outlook.com [40.107.104.68]) (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 B7BD6194A54; Wed, 15 Jan 2025 16:37:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736959064; cv=fail; b=bXiGLSxSyZ5TyyHqmbaVf6FXc2cvjrNbmZjzNL34WPQf3oS5OPF1TYh0vj3y0Zj+IC+BtqIMS5bxfTdS6FAk98FmprUtygbtrmeGM1X/fXjBc10ips6jQWG3Y8aRgtHA7NvnImMaXnwBGGEEkwEM7D7HRMRCXaXM51hqxN3flEE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736959064; c=relaxed/simple; bh=wtpNaREMXoeKvZyK2KJIhERJ8JA2vNi/7MLQlh7aSvE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=f3heXlp8rDLNT2aLbEUL9/LQKUqeXfeKacu92XmraR6ctJ5IbL1ksB2bnjQcx3B/n42wm35/CVoK/bM4AaVkD6vgVtlNLbu11asBh4tFWx3S1noqIhyC4QaK1xGraiANvFBaov9GQvISJeV8Dmw1tIeO2k6P8P43tikR8XAhSfc= 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=n2AXkztY; arc=fail smtp.client-ip=40.107.104.68 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="n2AXkztY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DIWW8d99U8MCY5xFWjol2N8p4Md1b4pYanS4tmtkiCrdhibNcf582NJz5HwJFO7+mSjc48TGxovNGhhPjizxOr5RIUJ2Hw4lFEwTI5+lkBUvRw1J69RRzvTztyLccgKjlixPKEDjOWC+BS0NNO6SG/t1o8xUff5DHJ0Xzs+C34ojK0zszApYcqlqCIgUFlqOwAGWU82DhBDF0iCL0vM/sykDlO8ZDdqYYjxbKEOZqswQOMypt9Aq5QF2pdvc+/fEASjwwKEZlMNWKHGiIuTIvzYSezvtjjyTfUzhGfFNdmFwi9YM7n7aITM/1D/2wtN++69VJAfLzW2Paosu3H6VXw== 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=jRe9+lZM2I1aLDz7V8EYgNMomijvzqACZ8+BxPNAUmg=; b=LXrQw2gFpkHOMBpHeSbkrj3d9UzGgO7uIZ0UE/Ki7lkoteqBHJDRx63L+y2+tFXuyIqPL0eP/VOPo5ZRn2NuGBBiuOaOPN3cisGtmu+vL1F9OWEOUye2N5ouIbT4VEkM+1mgFer1WDi0E4EiVkczlX6iACs+gW71Wzp5UH5ySfGFU+OSR0+7Soco157tKwr+mhh+pxC9v6XQxNsv2+OTXkuStNhfSH2TqatfKqkV5pwikomC5cPQq3XVSQK5pB89QzyO4QFnyxYjGcH2sRTqbEmyg+Otjgw4H9Zv81r/NnHqwjUrJEK60oTV+fnFKkr0fE8Sioxj39G9wq8+/SZb9g== 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=jRe9+lZM2I1aLDz7V8EYgNMomijvzqACZ8+BxPNAUmg=; b=n2AXkztYa8CO87imZm09bH3Qmu/P+RabmZbRbgwpVfPNGdCGlbZTK9Lw/CpEawO+yIUtUP/QdBR0h0PTMXzqTfCwWvXqCB80pzODrgcfTX5Z4GeztsNVonjmJJut999GBin33PCAu3oKJP8G8gx7UiS1WjMrgWXRMBhCn3WEumk+IDPEn9Rpw4rjqyytGAy0Qw1QGb9vcDHBni6EzwHd1esvYJX0CmRIR1sIHFKzpM4PgyHED8qlrINaAXwnRB/5JGn6ARscWSgNlYzNkg+pCVdIW0a5TppLHu2OHo7L3HVtKrvTLJPZLUXYUJFAm7yBIDu7qhDLYgLpFzY5Hh5cgg== 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 AS8PR04MB9079.eurprd04.prod.outlook.com (2603:10a6:20b:446::12) 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 16:37:40 +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 16:37:38 +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 v5 2/2] Bluetooth: btnxpuart: Add support for set BD address Date: Wed, 15 Jan 2025 22:08:46 +0530 Message-Id: <20250115163846.2385345-2-neeraj.sanjaykale@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250115163846.2385345-1-neeraj.sanjaykale@nxp.com> References: <20250115163846.2385345-1-neeraj.sanjaykale@nxp.com> X-ClientProxiedBy: SI2P153CA0010.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::13) 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_|AS8PR04MB9079:EE_ X-MS-Office365-Filtering-Correlation-Id: cb67833b-8e1d-4717-448a-08dd3582ec24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Ceq9djp/3BRedg4AI5BTp92cuAB2rIW?= =?utf-8?q?bV0F5pskuZBT+QiPnhBGBzu/xdjkhaOpYCckEVdNpK+b4e9xIuup/muF+WW5TXvAp?= =?utf-8?q?ILas8zX6Imejnd6bIihdsX7Ukb+O8xzcTeQOXc4hO7DlbIm8uMWSLTG0tK0SL/KpH?= =?utf-8?q?wPnjy9Q0UogORCxHGI43Qgz1dId3cA/xA+7MQNxtXp14/jOD8QiitplWjCSlw3LOF?= =?utf-8?q?VgXNaW8Ybc6LuSmV1VqlS2SZcqAGO8qRk+AHiOsWneyAmUXExGUlQXbDPXDyY4qds?= =?utf-8?q?NFHN0RIIuMMjgVJEqLj5F0657vRev4IjHMaqkhZd7T56dVmqbzrC41PQ0clbR3NRh?= =?utf-8?q?8f9cQPunmO1qL/M//YVhVpzCd6Zh9nOpNPA+2VmYqOdWA/Z55h7rby+9PCj9/dqk5?= =?ut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5MslW1VgFcG4Nq8B4JPBezz6WO9qqxp2Mu0eXaqMNVi+eSvMr0/yiOg?= =?utf-8?q?E5fpr/ObYvvvKq6vZPaxuixZDy1wV8eMOZTcraRUBCDxEQ+++6qCEf3kivNo6ZK97?= =?utf-8?q?VH0e/o5NMlH?= 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)(1800799024)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?85NHF3ewYOndctW3JZTJEaZ39Pmh?= =?utf-8?q?+Rq37w7MziPfDAMl+AHnKw9O6KZAQ+Ea/iZjcHhP1NtGxYFTiSk9YGzPNjJHVpEm2?= =?utf-8?q?Ofr5ydkwLMelKfPvMCIpc1Dv08kqbc+lPUiz7sxgcUtRtEeUfdNdsn2IMDQLP/d1z?= =?utf-8?q?BwdFdHzpmwImR02C5S5sSP/9NxpNBNV1nsN2NJnUGdrJb7aSOXh4PTzWBIW1E5d/o?= =?utf-8?q?MNrT+EYthTUTVvlw1Jeg5cmdX8wCt1RIVI15sJfOLLbacrUnymIIvlMQ8YwZHDg2D?= =?utf-8?q?1jk4OuNiZr8WGPVnZL5EdSERshwbrEK6fUBDcidXNmSfW2PfDKwCz5Z19HP9R1jxo?= =?utf-8?q?kUzoD8+GBXbPwLiIRSJWfq/H48YJRnj+WNA3QYX3LyTfh5UeSiHQhqTs4WoCvWOp2?= =?utf-8?q?XQGkQ5a39NwqWB9KCdWauOLMSwt+/6ByXmUTSacJj+YlxrsKwwVWzoOmDI37ptUXl?= =?utf-8?q?WGF2Qoai50R5CM27+Fsi5zRZRVqOo7Q5mxqXKk84j0NaB5FRT3PDJuuFfYm0vLU+L?= =?utf-8?q?m8g2mz58rwH69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M4GwR13631u8FCCBOVTHqT4WOgwFUxTd2NzD5pw5b6oj?= =?utf-8?q?zKol7VpDbN/5WoEnKgZB1zZRlQkP7ezKfV3gjdEDs9xZTJHK0L4UeGJxgwimlFT97?= =?utf-8?q?XxGVW3appLxyDweECmk+eix4B7n3DE40WA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb67833b-8e1d-4717-448a-08dd3582ec24 X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9692.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 16:37:38.1924 (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: EBrllZDiVRiebvS13w4LasYLwQMX08w6H/ZvTpkn+u7NP5FbenUzNItI9NdYBGsqJq2JLiS1uf6fD1bxgvoju5pqe8lLgegM4zkDc4IzbqM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9079 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) v5: Initialize local variable ba, update Copywrite year. (Kristian) --- drivers/bluetooth/btnxpuart.c | 39 ++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index 1230045d78a5..dd9161bfd52c 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * NXP Bluetooth driver - * Copyright 2023 NXP + * Copyright 2023-2025 NXP */ #include @@ -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 = {0}; 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;