1/*
2 * Copyright (c) 2021 Florin Stancu
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/ {
8	/**
9	 * The CC1352P LAUNCHXL has an on-board antenna switch (SKY13317-373LF) used to select the
10	 * appropriate RF signal port based on the currently-used PHY.
11	 *
12	 * Truth table:
13	 *
14	 * Path        DIO28 DIO29 DIO30
15	 * =========== ===== ===== =====
16	 * Off         0     0     0
17	 * Sub-1 GHz   0     0     1     // DIO30 mux to IOC_PORT_RFC_GPO0 for auto
18	 * 2.4 GHz     1     0     0     // DIO28 mux to IOC_PORT_RFC_GPO0 for auto
19	 * 20 dBm TX   0     1     0     // DIO29 mux to IOC_PORT_RFC_GPO3 for auto
20	 */
21	antenna_mux0: antenna_mux0 {
22		compatible = "skyworks,sky13317";
23		status = "okay";
24		gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>, <&gpio0 29 GPIO_ACTIVE_HIGH>, \
25				<&gpio0 30 GPIO_ACTIVE_HIGH>;
26		pinctrl-0 = <&board_ant_24g_off &board_ant_tx_pa_off &board_ant_subg_off>;
27		pinctrl-1 = <&board_ant_24g_on &board_ant_tx_pa_off &board_ant_subg_off>;
28		pinctrl-2 = <&board_ant_24g_on &board_ant_tx_pa_on &board_ant_subg_off>;
29		pinctrl-3 = <&board_ant_24g_off &board_ant_tx_pa_off &board_ant_subg_on>;
30		pinctrl-4 = <&board_ant_24g_off &board_ant_tx_pa_on &board_ant_subg_on>;
31		pinctrl-names = "default", "ant_24g", "ant_24g_pa", "ant_subg", "ant_subg_pa";
32	};
33};
34
35&pinctrl {
36	/* On-board antenna pinmux states */
37	board_ant_24g_off: board_ant_24g_off {
38		pinmux = <28 IOC_PORT_GPIO>;
39		bias-disable;
40	};
41	board_ant_24g_on: board_ant_24g_on {
42		pinmux = <28 IOC_PORT_RFC_GPO0>;
43		bias-disable;
44	};
45	board_ant_tx_pa_off: board_ant_tx_pa_off {
46		pinmux = <29 IOC_PORT_GPIO>;
47		bias-disable;
48	};
49	board_ant_tx_pa_on: board_ant_tx_pa_on {
50		pinmux = <29 IOC_PORT_RFC_GPO3>;
51		bias-disable;
52	};
53	board_ant_subg_off: board_ant_subg_off {
54		pinmux = <30 IOC_PORT_GPIO>;
55		bias-disable;
56	};
57	board_ant_subg_on: board_ant_subg_on {
58		pinmux = <30 IOC_PORT_RFC_GPO0>;
59		bias-disable;
60	};
61};
62