mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
isc_gpio: Enable build of isc_gpio for Linux 6.2
The build of isc_gpio driver was disabled for Linux 6.2 as there is change in API in core kernel. Enable build of isc_gpio driver with appropriate modification in driver for Linux 6.2. Bug 4346767 Change-Id: Id520231dcfb2daa8efeb9eeb8db8d7d18c7ecb74 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031554 GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
c94946a0bb
commit
103ebd91bc
@@ -3,12 +3,7 @@
|
|||||||
|
|
||||||
GCOV_PROFILE := y
|
GCOV_PROFILE := y
|
||||||
|
|
||||||
LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL))
|
|
||||||
LINUX_VERSION_6_3 := $(shell expr 6 \* 256 + 3)
|
|
||||||
|
|
||||||
ifneq ($(CONFIG_TEGRA_GPIO_LEGACY_DISABLE),y)
|
|
||||||
obj-m += isc_gpio.o
|
obj-m += isc_gpio.o
|
||||||
endif
|
|
||||||
obj-m += isc_mgr.o
|
obj-m += isc_mgr.o
|
||||||
obj-m += isc_dev.o
|
obj-m += isc_dev.o
|
||||||
obj-m += isc_pwm.o
|
obj-m += isc_pwm.o
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2017-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// Copyright (c) 2017-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
@@ -41,6 +43,9 @@ static struct gpio_chip *isc_gpio_get_chip(struct platform_device *pdev,
|
|||||||
{
|
{
|
||||||
struct gpio_chip *gc = NULL;
|
struct gpio_chip *gc = NULL;
|
||||||
char name[MAX_STR_SIZE];
|
char name[MAX_STR_SIZE];
|
||||||
|
#if !defined(NV_GPIOCHIP_FIND_PRESENT) /* Linux 6.7 */
|
||||||
|
struct gpio_device *gdev;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (strlen(pd->gpio_prnt_chip) > MAX_STR_SIZE) {
|
if (strlen(pd->gpio_prnt_chip) > MAX_STR_SIZE) {
|
||||||
dev_err(&pdev->dev, "%s: gpio chip name is too long: %s\n",
|
dev_err(&pdev->dev, "%s: gpio chip name is too long: %s\n",
|
||||||
@@ -49,7 +54,15 @@ static struct gpio_chip *isc_gpio_get_chip(struct platform_device *pdev,
|
|||||||
}
|
}
|
||||||
strcpy(name, pd->gpio_prnt_chip);
|
strcpy(name, pd->gpio_prnt_chip);
|
||||||
|
|
||||||
|
#if defined(NV_GPIOCHIP_FIND_PRESENT) /* Linux 6.7 */
|
||||||
gc = gpiochip_find(name, isc_gpio_chip_match);
|
gc = gpiochip_find(name, isc_gpio_chip_match);
|
||||||
|
#else
|
||||||
|
gdev = gpio_device_find(name, isc_gpio_chip_match);
|
||||||
|
if (gdev) {
|
||||||
|
gc = gpio_device_get_chip(gdev);
|
||||||
|
gpio_device_put(gdev);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!gc) {
|
if (!gc) {
|
||||||
dev_err(&pdev->dev, "%s: unable to find gpio parent chip %s\n",
|
dev_err(&pdev->dev, "%s: unable to find gpio parent chip %s\n",
|
||||||
__func__, pd->gpio_prnt_chip);
|
__func__, pd->gpio_prnt_chip);
|
||||||
@@ -275,7 +288,9 @@ static int isc_gpio_probe(struct platform_device *pdev)
|
|||||||
gc->base = -1;
|
gc->base = -1;
|
||||||
gc->ngpio = pd->max_gpio;
|
gc->ngpio = pd->max_gpio;
|
||||||
gc->label = "isc-gpio";
|
gc->label = "isc-gpio";
|
||||||
|
#if defined(NV_GPIO_CHIP_STRUCT_HAS_OF_NODE_PRESENT) /* Linux 6.2 */
|
||||||
gc->of_node = pdev->dev.of_node;
|
gc->of_node = pdev->dev.of_node;
|
||||||
|
#endif
|
||||||
gc->owner = THIS_MODULE;
|
gc->owner = THIS_MODULE;
|
||||||
|
|
||||||
err = gpiochip_add_data(gc, isc_gpio);
|
err = gpiochip_add_data(gc, isc_gpio);
|
||||||
|
|||||||
Reference in New Issue
Block a user