isc_mgr: Enable build of isc_mgr for Linux 6.2

The build of isc_mgr driver was disabled for Linux 6.2
as there is change in API in core kernel.

Enable build of isc_mgr driver with appropriate modification
in driver for Linux 6.2.

Bug 4346767

Change-Id: Ieb7d55d6068d1d893fcc8bfac7aa71c2ba1dece9
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031553
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-10 13:04:15 +00:00
committed by mobile promotions
parent 6fcf226b96
commit c94946a0bb
2 changed files with 11 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ LINUX_VERSION_6_3 := $(shell expr 6 \* 256 + 3)
ifneq ($(CONFIG_TEGRA_GPIO_LEGACY_DISABLE),y)
obj-m += isc_gpio.o
obj-m += isc_mgr.o
endif
obj-m += isc_mgr.o
obj-m += isc_dev.o
obj-m += isc_pwm.o

View File

@@ -9,6 +9,7 @@
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
@@ -815,13 +816,22 @@ static int isc_mgr_of_get_grp_gpio(
{
int num, i;
#if defined(NV_OF_GPIO_NAMED_COUNT_PRESENT) /* Linux 6.2 */
num = of_gpio_named_count(np, name);
#else
num = of_count_phandle_with_args(np, name, "#gpio-cells");
#endif
dev_dbg(dev, " num gpios of %s: %d\n", name, num);
if (num < 0)
return 0;
for (i = 0; (i < num) && (i < size); i++) {
#if defined(NV_OF_GET_NAMED_GPIO_FLAGS_PRESENT) /* Linux 6.2 */
grp[i] = of_get_named_gpio_flags(np, name, i, &flags[i]);
#else
grp[i] = of_get_named_gpio(np, name, i);
flags[i] = 0;
#endif
if ((int)grp[i] < 0) {
dev_err(dev, "%s: gpio[%d] invalid\n", __func__, i);
return -EINVAL;