hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
....@@ -1,15 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Pin controller and GPIO driver for Amlogic Meson GXBB.
34 *
45 * Copyright (C) 2016 Endless Mobile, Inc.
56 * Author: Carlo Caione <carlo@endlessm.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * version 2 as published by the Free Software Foundation.
10
- *
11
- * You should have received a copy of the GNU General Public License
12
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
137 */
148
159 #include <dt-bindings/gpio/meson-gxbb-gpio.h>
....@@ -237,9 +231,23 @@
237231 static const unsigned int hdmi_sda_pins[] = { GPIOH_1 };
238232 static const unsigned int hdmi_scl_pins[] = { GPIOH_2 };
239233
234
+static const unsigned int tsin_a_d_valid_pins[] = { GPIOY_0 };
235
+static const unsigned int tsin_a_sop_pins[] = { GPIOY_1 };
236
+static const unsigned int tsin_a_clk_pins[] = { GPIOY_2 };
237
+static const unsigned int tsin_a_d0_pins[] = { GPIOY_3 };
238
+static const unsigned int tsin_a_dp_pins[] = {
239
+ GPIOY_4, GPIOY_5, GPIOY_6, GPIOY_7, GPIOY_8, GPIOY_9, GPIOY_10
240
+};
241
+
242
+static const unsigned int tsin_a_fail_pins[] = { GPIOY_11 };
240243 static const unsigned int i2s_out_ch23_y_pins[] = { GPIOY_8 };
241244 static const unsigned int i2s_out_ch45_y_pins[] = { GPIOY_9 };
242245 static const unsigned int i2s_out_ch67_y_pins[] = { GPIOY_10 };
246
+
247
+static const unsigned int tsin_b_d_valid_pins[] = { GPIOX_6 };
248
+static const unsigned int tsin_b_sop_pins[] = { GPIOX_7 };
249
+static const unsigned int tsin_b_clk_pins[] = { GPIOX_8 };
250
+static const unsigned int tsin_b_d0_pins[] = { GPIOX_9 };
243251
244252 static const unsigned int spdif_out_y_pins[] = { GPIOY_12 };
245253
....@@ -443,12 +451,22 @@
443451 GROUP(pwm_a_x, 3, 17),
444452 GROUP(pwm_e, 2, 30),
445453 GROUP(pwm_f_x, 3, 18),
454
+ GROUP(tsin_b_d_valid, 3, 9),
455
+ GROUP(tsin_b_sop, 3, 8),
456
+ GROUP(tsin_b_clk, 3, 10),
457
+ GROUP(tsin_b_d0, 3, 7),
446458
447459 /* Bank Y */
448460 GROUP(uart_cts_c, 1, 17),
449461 GROUP(uart_rts_c, 1, 16),
450462 GROUP(uart_tx_c, 1, 19),
451463 GROUP(uart_rx_c, 1, 18),
464
+ GROUP(tsin_a_fail, 3, 3),
465
+ GROUP(tsin_a_d_valid, 3, 2),
466
+ GROUP(tsin_a_sop, 3, 1),
467
+ GROUP(tsin_a_clk, 3, 0),
468
+ GROUP(tsin_a_d0, 3, 4),
469
+ GROUP(tsin_a_dp, 3, 5),
452470 GROUP(pwm_a_y, 1, 21),
453471 GROUP(pwm_f_y, 1, 20),
454472 GROUP(i2s_out_ch23_y, 1, 5),
....@@ -605,6 +623,15 @@
605623 "GPIOX_10", "GPIOX_11", "GPIOX_12", "GPIOX_13", "GPIOX_14",
606624 "GPIOX_15", "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19",
607625 "GPIOX_20", "GPIOX_21", "GPIOX_22",
626
+};
627
+
628
+static const char * const tsin_a_groups[] = {
629
+ "tsin_a_clk", "tsin_a_sop", "tsin_a_d_valid", "tsin_a_d0",
630
+ "tsin_a_dp", "tsin_a_fail",
631
+};
632
+
633
+static const char * const tsin_b_groups[] = {
634
+ "tsin_b_clk", "tsin_b_sop", "tsin_b_d_valid", "tsin_b_d0",
608635 };
609636
610637 static const char * const emmc_groups[] = {
....@@ -798,6 +825,8 @@
798825 FUNCTION(i2s_out),
799826 FUNCTION(spdif_out),
800827 FUNCTION(gen_clk_out),
828
+ FUNCTION(tsin_a),
829
+ FUNCTION(tsin_b),
801830 };
802831
803832 static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
....@@ -857,6 +886,7 @@
857886 .num_funcs = ARRAY_SIZE(meson_gxbb_aobus_functions),
858887 .num_banks = ARRAY_SIZE(meson_gxbb_aobus_banks),
859888 .pmx_ops = &meson8_pmx_ops,
889
+ .parse_dt = meson8_aobus_parse_dt_extra,
860890 };
861891
862892 static const struct of_device_id meson_gxbb_pinctrl_dt_match[] = {
....@@ -870,6 +900,7 @@
870900 },
871901 { },
872902 };
903
+MODULE_DEVICE_TABLE(of, meson_gxbb_pinctrl_dt_match);
873904
874905 static struct platform_driver meson_gxbb_pinctrl_driver = {
875906 .probe = meson_pinctrl_probe,
....@@ -878,4 +909,5 @@
878909 .of_match_table = meson_gxbb_pinctrl_dt_match,
879910 },
880911 };
881
-builtin_platform_driver(meson_gxbb_pinctrl_driver);
912
+module_platform_driver(meson_gxbb_pinctrl_driver);
913
+MODULE_LICENSE("GPL v2");