gpio-tps6586x.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) | gpio-tps6586x.c (79c676f808541b8ad174b0261596da8e1d9d26a3) |
---|---|
1/* 2 * TI TPS6586x GPIO driver 3 * 4 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 5 * Author: Laxman dewangan <ldewangan@nvidia.com> 6 * 7 * Based on tps6586x.c 8 * Copyright (c) 2010 CompuLab Ltd. --- 103 unchanged lines hidden (view full) --- 112#ifdef CONFIG_OF_GPIO 113 tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node; 114#endif 115 if (pdata && pdata->gpio_base) 116 tps6586x_gpio->gpio_chip.base = pdata->gpio_base; 117 else 118 tps6586x_gpio->gpio_chip.base = -1; 119 | 1/* 2 * TI TPS6586x GPIO driver 3 * 4 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 5 * Author: Laxman dewangan <ldewangan@nvidia.com> 6 * 7 * Based on tps6586x.c 8 * Copyright (c) 2010 CompuLab Ltd. --- 103 unchanged lines hidden (view full) --- 112#ifdef CONFIG_OF_GPIO 113 tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node; 114#endif 115 if (pdata && pdata->gpio_base) 116 tps6586x_gpio->gpio_chip.base = pdata->gpio_base; 117 else 118 tps6586x_gpio->gpio_chip.base = -1; 119 |
120 ret = gpiochip_add_data(&tps6586x_gpio->gpio_chip, tps6586x_gpio); | 120 ret = devm_gpiochip_add_data(&pdev->dev, &tps6586x_gpio->gpio_chip, 121 tps6586x_gpio); |
121 if (ret < 0) { 122 dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); 123 return ret; 124 } 125 126 platform_set_drvdata(pdev, tps6586x_gpio); 127 128 return ret; 129} 130 | 122 if (ret < 0) { 123 dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); 124 return ret; 125 } 126 127 platform_set_drvdata(pdev, tps6586x_gpio); 128 129 return ret; 130} 131 |
131static int tps6586x_gpio_remove(struct platform_device *pdev) 132{ 133 struct tps6586x_gpio *tps6586x_gpio = platform_get_drvdata(pdev); 134 135 gpiochip_remove(&tps6586x_gpio->gpio_chip); 136 return 0; 137} 138 | |
139static struct platform_driver tps6586x_gpio_driver = { 140 .driver.name = "tps6586x-gpio", 141 .driver.owner = THIS_MODULE, 142 .probe = tps6586x_gpio_probe, | 132static struct platform_driver tps6586x_gpio_driver = { 133 .driver.name = "tps6586x-gpio", 134 .driver.owner = THIS_MODULE, 135 .probe = tps6586x_gpio_probe, |
143 .remove = tps6586x_gpio_remove, | |
144}; 145 146static int __init tps6586x_gpio_init(void) 147{ 148 return platform_driver_register(&tps6586x_gpio_driver); 149} 150subsys_initcall(tps6586x_gpio_init); 151 152static void __exit tps6586x_gpio_exit(void) 153{ 154 platform_driver_unregister(&tps6586x_gpio_driver); 155} 156module_exit(tps6586x_gpio_exit); 157 158MODULE_ALIAS("platform:tps6586x-gpio"); 159MODULE_DESCRIPTION("GPIO interface for TPS6586X PMIC"); 160MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 161MODULE_LICENSE("GPL"); | 136}; 137 138static int __init tps6586x_gpio_init(void) 139{ 140 return platform_driver_register(&tps6586x_gpio_driver); 141} 142subsys_initcall(tps6586x_gpio_init); 143 144static void __exit tps6586x_gpio_exit(void) 145{ 146 platform_driver_unregister(&tps6586x_gpio_driver); 147} 148module_exit(tps6586x_gpio_exit); 149 150MODULE_ALIAS("platform:tps6586x-gpio"); 151MODULE_DESCRIPTION("GPIO interface for TPS6586X PMIC"); 152MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 153MODULE_LICENSE("GPL"); |