pinctrl-microchip-sgpio.c (6323f916686d4e9d299a53114b28ecaf833422cd) | pinctrl-microchip-sgpio.c (2f65923c5032c9de0d898636d4cd25da5d58e9a7) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Microsemi/Microchip SoCs serial gpio driver 4 * 5 * Author: Lars Povlsen <lars.povlsen@microchip.com> 6 * 7 * Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries. 8 */ --- 850 unchanged lines hidden (view full) --- 859 gc->free = gpiochip_generic_free; 860 gc->of_xlate = microchip_sgpio_of_xlate; 861 gc->of_gpio_n_cells = 3; 862 gc->base = -1; 863 gc->ngpio = ngpios; 864 gc->can_sleep = !bank->is_input; 865 866 if (bank->is_input && priv->properties->flags & SGPIO_FLAGS_HAS_IRQ) { | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Microsemi/Microchip SoCs serial gpio driver 4 * 5 * Author: Lars Povlsen <lars.povlsen@microchip.com> 6 * 7 * Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries. 8 */ --- 850 unchanged lines hidden (view full) --- 859 gc->free = gpiochip_generic_free; 860 gc->of_xlate = microchip_sgpio_of_xlate; 861 gc->of_gpio_n_cells = 3; 862 gc->base = -1; 863 gc->ngpio = ngpios; 864 gc->can_sleep = !bank->is_input; 865 866 if (bank->is_input && priv->properties->flags & SGPIO_FLAGS_HAS_IRQ) { |
867 int irq; | 867 int irq = fwnode_irq_get(fwnode, 0); |
868 | 868 |
869 irq = fwnode_irq_get(fwnode, 0); 870 if (irq > 0) { | 869 if (irq) { |
871 struct gpio_irq_chip *girq = &gc->irq; 872 873 gpio_irq_chip_set_chip(girq, µchip_sgpio_irqchip); 874 girq->parent_handler = sgpio_irq_handler; 875 girq->num_parents = 1; 876 girq->parents = devm_kcalloc(dev, 1, 877 sizeof(*girq->parents), 878 GFP_KERNEL); --- 116 unchanged lines hidden (view full) --- 995 .data = &properties_luton, 996 }, { 997 .compatible = "mscc,ocelot-sgpio", 998 .data = &properties_ocelot, 999 }, { 1000 /* sentinel */ 1001 } 1002}; | 870 struct gpio_irq_chip *girq = &gc->irq; 871 872 gpio_irq_chip_set_chip(girq, µchip_sgpio_irqchip); 873 girq->parent_handler = sgpio_irq_handler; 874 girq->num_parents = 1; 875 girq->parents = devm_kcalloc(dev, 1, 876 sizeof(*girq->parents), 877 GFP_KERNEL); --- 116 unchanged lines hidden (view full) --- 994 .data = &properties_luton, 995 }, { 996 .compatible = "mscc,ocelot-sgpio", 997 .data = &properties_ocelot, 998 }, { 999 /* sentinel */ 1000 } 1001}; |
1002MODULE_DEVICE_TABLE(of, microchip_sgpio_gpio_of_match); |
|
1003 1004static struct platform_driver microchip_sgpio_pinctrl_driver = { 1005 .driver = { 1006 .name = "pinctrl-microchip-sgpio", 1007 .of_match_table = microchip_sgpio_gpio_of_match, 1008 .suppress_bind_attrs = true, 1009 }, 1010 .probe = microchip_sgpio_probe, 1011}; | 1003 1004static struct platform_driver microchip_sgpio_pinctrl_driver = { 1005 .driver = { 1006 .name = "pinctrl-microchip-sgpio", 1007 .of_match_table = microchip_sgpio_gpio_of_match, 1008 .suppress_bind_attrs = true, 1009 }, 1010 .probe = microchip_sgpio_probe, 1011}; |
1012builtin_platform_driver(microchip_sgpio_pinctrl_driver); | 1012module_platform_driver(microchip_sgpio_pinctrl_driver); 1013 1014MODULE_DESCRIPTION("Microchip SGPIO Pinctrl Driver"); 1015MODULE_LICENSE("GPL"); |