| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Pin controller and GPIO driver for Amlogic Meson GXL. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2016 Endless Mobile, Inc. |
|---|
| 5 | 6 | * 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/>. |
|---|
| 13 | 7 | */ |
|---|
| 14 | 8 | |
|---|
| 15 | 9 | #include <dt-bindings/gpio/meson-gxl-gpio.h> |
|---|
| .. | .. |
|---|
| 247 | 241 | GPIODV_1, GPIODV_2, GPIODV_3, GPIODV_4, GPIODV_5, GPIODV_6, GPIODV_7, |
|---|
| 248 | 242 | }; |
|---|
| 249 | 243 | |
|---|
| 244 | +static const unsigned int tsin_b_clk_pins[] = { GPIOH_6 }; |
|---|
| 245 | +static const unsigned int tsin_b_d0_pins[] = { GPIOH_7 }; |
|---|
| 246 | +static const unsigned int tsin_b_sop_pins[] = { GPIOH_8 }; |
|---|
| 247 | +static const unsigned int tsin_b_d_valid_pins[] = { GPIOH_9 }; |
|---|
| 248 | + |
|---|
| 249 | +static const unsigned int tsin_b_fail_z4_pins[] = { GPIOZ_4 }; |
|---|
| 250 | +static const unsigned int tsin_b_clk_z3_pins[] = { GPIOZ_3 }; |
|---|
| 251 | +static const unsigned int tsin_b_d0_z2_pins[] = { GPIOZ_2 }; |
|---|
| 252 | +static const unsigned int tsin_b_sop_z1_pins[] = { GPIOZ_1 }; |
|---|
| 253 | +static const unsigned int tsin_b_d_valid_z0_pins[] = { GPIOZ_0 }; |
|---|
| 254 | + |
|---|
| 250 | 255 | static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = { |
|---|
| 251 | 256 | MESON_PIN(GPIOAO_0), |
|---|
| 252 | 257 | MESON_PIN(GPIOAO_1), |
|---|
| .. | .. |
|---|
| 444 | 449 | GROUP(eth_txd1, 4, 12), |
|---|
| 445 | 450 | GROUP(eth_txd2, 4, 11), |
|---|
| 446 | 451 | GROUP(eth_txd3, 4, 10), |
|---|
| 452 | + GROUP(tsin_b_fail_z4, 3, 15), |
|---|
| 453 | + GROUP(tsin_b_clk_z3, 3, 16), |
|---|
| 454 | + GROUP(tsin_b_d0_z2, 3, 17), |
|---|
| 455 | + GROUP(tsin_b_sop_z1, 3, 18), |
|---|
| 456 | + GROUP(tsin_b_d_valid_z0, 3, 19), |
|---|
| 447 | 457 | GROUP(pwm_c, 3, 20), |
|---|
| 448 | 458 | GROUP(i2s_out_ch23_z, 3, 26), |
|---|
| 449 | 459 | GROUP(i2s_out_ch45_z, 3, 25), |
|---|
| .. | .. |
|---|
| 460 | 470 | GROUP(i2s_out_lr_clk, 6, 24), |
|---|
| 461 | 471 | GROUP(i2s_out_ch01, 6, 23), |
|---|
| 462 | 472 | GROUP(spdif_out_h, 6, 28), |
|---|
| 473 | + GROUP(tsin_b_d0, 6, 17), |
|---|
| 474 | + GROUP(tsin_b_sop, 6, 18), |
|---|
| 475 | + GROUP(tsin_b_d_valid, 6, 19), |
|---|
| 476 | + GROUP(tsin_b_clk, 6, 20), |
|---|
| 463 | 477 | |
|---|
| 464 | 478 | /* Bank DV */ |
|---|
| 465 | 479 | GROUP(uart_tx_b, 2, 16), |
|---|
| .. | .. |
|---|
| 695 | 709 | "tsin_a_dp", "tsin_a_fail", |
|---|
| 696 | 710 | }; |
|---|
| 697 | 711 | |
|---|
| 712 | +static const char * const tsin_b_groups[] = { |
|---|
| 713 | + "tsin_b_clk", "tsin_b_sop", "tsin_b_d_valid", "tsin_b_d0", |
|---|
| 714 | + "tsin_b_clk_z3", "tsin_b_sop_z1", "tsin_b_d_valid_z0", "tsin_b_d0_z2", |
|---|
| 715 | + "tsin_b_fail_z4", |
|---|
| 716 | +}; |
|---|
| 717 | + |
|---|
| 698 | 718 | static const char * const gpio_aobus_groups[] = { |
|---|
| 699 | 719 | "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", |
|---|
| 700 | 720 | "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", |
|---|
| .. | .. |
|---|
| 770 | 790 | FUNCTION(spdif_out), |
|---|
| 771 | 791 | FUNCTION(eth_led), |
|---|
| 772 | 792 | FUNCTION(tsin_a), |
|---|
| 793 | + FUNCTION(tsin_b), |
|---|
| 773 | 794 | }; |
|---|
| 774 | 795 | |
|---|
| 775 | 796 | static struct meson_pmx_func meson_gxl_aobus_functions[] = { |
|---|
| .. | .. |
|---|
| 826 | 847 | .num_funcs = ARRAY_SIZE(meson_gxl_aobus_functions), |
|---|
| 827 | 848 | .num_banks = ARRAY_SIZE(meson_gxl_aobus_banks), |
|---|
| 828 | 849 | .pmx_ops = &meson8_pmx_ops, |
|---|
| 850 | + .parse_dt = meson8_aobus_parse_dt_extra, |
|---|
| 829 | 851 | }; |
|---|
| 830 | 852 | |
|---|
| 831 | 853 | static const struct of_device_id meson_gxl_pinctrl_dt_match[] = { |
|---|
| .. | .. |
|---|
| 839 | 861 | }, |
|---|
| 840 | 862 | { }, |
|---|
| 841 | 863 | }; |
|---|
| 864 | +MODULE_DEVICE_TABLE(of, meson_gxl_pinctrl_dt_match); |
|---|
| 842 | 865 | |
|---|
| 843 | 866 | static struct platform_driver meson_gxl_pinctrl_driver = { |
|---|
| 844 | 867 | .probe = meson_pinctrl_probe, |
|---|
| .. | .. |
|---|
| 847 | 870 | .of_match_table = meson_gxl_pinctrl_dt_match, |
|---|
| 848 | 871 | }, |
|---|
| 849 | 872 | }; |
|---|
| 850 | | -builtin_platform_driver(meson_gxl_pinctrl_driver); |
|---|
| 873 | +module_platform_driver(meson_gxl_pinctrl_driver); |
|---|
| 874 | +MODULE_LICENSE("GPL v2"); |
|---|