Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "serial: sccnxp: Add DT support"

This reverts commit 85c996907473e4ef824774b97b26499adf66521f.

Alexander wishes to remove this patch as it is incorrect.

Reported-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+12 -93
-53
Documentation/devicetree/bindings/tty/serial/sccnxp-serial.txt
··· 1 - * NXP (Philips) SCC+++(SCN+++) serial driver 2 - 3 - Required properties: 4 - - compatible: Should be "nxp,<ictype>". The supported ICs include sc2681, 5 - sc2691, sc2692, sc2891, sc2892, sc28202, sc68681 and sc68692. 6 - - reg: Address and length of the register set for the device. 7 - - interrupts: Should contain the interrupt number. If omitted, 8 - polling mode will be used instead, so "poll-interval" property should 9 - be populated in this case. 10 - 11 - Optional properties: 12 - - clocks: Phandle to input clock. If omitted, default IC frequency will be 13 - used instead. 14 - - poll-interval: Poll interval time in nanoseconds. 15 - - vcc-supply: The regulator supplying the VCC to drive the chip. 16 - - nxp,sccnxp-io-cfg: Array contains values for the emulated modem signals. 17 - The number of values depends on the UART-number in the selected chip. 18 - Each value should be composed according to the following rules: 19 - (LINE1 << SIGNAL1) | ... | (LINEX << SIGNALX), where: 20 - LINE - VALUE: 21 - OP0 - 1 22 - OP1 - 2 23 - OP2 - 3 24 - OP3 - 4 25 - OP4 - 5 26 - OP5 - 6 27 - OP6 - 7 28 - OP7 - 8 29 - IP0 - 9 30 - IP1 - 10 31 - IP2 - 11 32 - IP3 - 12 33 - IP4 - 13 34 - IP5 - 14 35 - IP6 - 15 36 - SIGNAL - VALUE: 37 - DTR - 0 38 - RTS - 4 39 - DSR - 8 40 - CTS - 12 41 - DCD - 16 42 - RNG - 20 43 - DIR - 24 44 - 45 - Example (Dual UART with direction control on OP0 & OP1): 46 - sc2892@10100000 { 47 - compatible = "nxp,sc2892"; 48 - reg = <0x10100000 0x10>; 49 - poll-interval = <10000>; 50 - clocks = <&sc2892_clk>; 51 - vcc-supply = <&sc2892_reg>; 52 - nxp,sccnxp-io-cfg = <0x01000000 0x02000000>; 53 - };
+9 -37
drivers/tty/serial/sccnxp.c
··· 20 20 #include <linux/module.h> 21 21 #include <linux/device.h> 22 22 #include <linux/console.h> 23 - #include <linux/of.h> 24 - #include <linux/of_device.h> 25 23 #include <linux/serial_core.h> 26 24 #include <linux/serial.h> 27 25 #include <linux/io.h> ··· 853 855 }; 854 856 MODULE_DEVICE_TABLE(platform, sccnxp_id_table); 855 857 856 - static const struct of_device_id sccnxp_dt_id_table[] = { 857 - { .compatible = "nxp,sc2681", .data = &sc2681, }, 858 - { .compatible = "nxp,sc2691", .data = &sc2691, }, 859 - { .compatible = "nxp,sc2692", .data = &sc2692, }, 860 - { .compatible = "nxp,sc2891", .data = &sc2891, }, 861 - { .compatible = "nxp,sc2892", .data = &sc2892, }, 862 - { .compatible = "nxp,sc28202", .data = &sc28202, }, 863 - { .compatible = "nxp,sc68681", .data = &sc68681, }, 864 - { .compatible = "nxp,sc68692", .data = &sc68692, }, 865 - { } 866 - }; 867 - MODULE_DEVICE_TABLE(of, sccnxp_dt_id_table); 868 - 869 858 static int sccnxp_probe(struct platform_device *pdev) 870 859 { 871 860 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 872 861 struct sccnxp_pdata *pdata = dev_get_platdata(&pdev->dev); 873 - const struct of_device_id *of_id = 874 - of_match_device(sccnxp_dt_id_table, &pdev->dev); 875 862 int i, ret, uartclk; 876 863 struct sccnxp_port *s; 877 864 void __iomem *membase; ··· 875 892 876 893 spin_lock_init(&s->lock); 877 894 878 - if (of_id) { 879 - s->chip = (struct sccnxp_chip *)of_id->data; 880 - 881 - of_property_read_u32(pdev->dev.of_node, "poll-interval", 882 - &s->pdata.poll_time_us); 883 - of_property_read_u32(pdev->dev.of_node, "reg-shift", 884 - &s->pdata.reg_shift); 885 - of_property_read_u32_array(pdev->dev.of_node, 886 - "nxp,sccnxp-io-cfg", 887 - s->pdata.mctrl_cfg, s->chip->nr); 888 - } else { 889 - s->chip = (struct sccnxp_chip *)pdev->id_entry->driver_data; 890 - 891 - if (pdata) 892 - memcpy(&s->pdata, pdata, sizeof(struct sccnxp_pdata)); 893 - } 895 + s->chip = (struct sccnxp_chip *)pdev->id_entry->driver_data; 894 896 895 897 s->regulator = devm_regulator_get(&pdev->dev, "vcc"); 896 898 if (!IS_ERR(s->regulator)) { ··· 906 938 goto err_out; 907 939 } 908 940 941 + if (pdata) 942 + memcpy(&s->pdata, pdata, sizeof(struct sccnxp_pdata)); 943 + 909 944 if (s->pdata.poll_time_us) { 910 945 dev_info(&pdev->dev, "Using poll mode, resolution %u usecs\n", 911 946 s->pdata.poll_time_us); 912 947 s->poll = 1; 913 - } else { 948 + } 949 + 950 + if (!s->poll) { 914 951 s->irq = platform_get_irq(pdev, 0); 915 952 if (s->irq < 0) { 916 953 dev_err(&pdev->dev, "Missing irq resource data\n"); ··· 1016 1043 1017 1044 static struct platform_driver sccnxp_uart_driver = { 1018 1045 .driver = { 1019 - .name = SCCNXP_NAME, 1020 - .owner = THIS_MODULE, 1021 - .of_match_table = sccnxp_dt_id_table, 1046 + .name = SCCNXP_NAME, 1047 + .owner = THIS_MODULE, 1022 1048 }, 1023 1049 .probe = sccnxp_probe, 1024 1050 .remove = sccnxp_remove,
+3 -3
include/linux/platform_data/serial-sccnxp.h
··· 78 78 /* SCCNXP platform data structure */ 79 79 struct sccnxp_pdata { 80 80 /* Shift for A0 line */ 81 - u32 reg_shift; 81 + const u8 reg_shift; 82 82 /* Modem control lines configuration */ 83 - u32 mctrl_cfg[SCCNXP_MAX_UARTS]; 83 + const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; 84 84 /* Timer value for polling mode (usecs) */ 85 - u32 poll_time_us; 85 + const unsigned int poll_time_us; 86 86 }; 87 87 88 88 #endif