diff --git a/drivers/media/platform/tegra/isc/Makefile b/drivers/media/platform/tegra/isc/Makefile index f1e02bdc..40febd60 100644 --- a/drivers/media/platform/tegra/isc/Makefile +++ b/drivers/media/platform/tegra/isc/Makefile @@ -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 diff --git a/drivers/media/platform/tegra/isc/isc_mgr.c b/drivers/media/platform/tegra/isc/isc_mgr.c index 8474e7cc..8599e74c 100644 --- a/drivers/media/platform/tegra/isc/isc_mgr.c +++ b/drivers/media/platform/tegra/isc/isc_mgr.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -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;