mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
cdi_mgr: Enable build of cdi_mgr for Linux 6.2
The build of cdi_mgr driver was disabled for Linux 6.2
as there is change in API in core kernel.
Enable build of cdi_mgr driver with appropriate modification
in driver for Linux 6.2.
Bug 4346767
Change-Id: I6315482b593926e1382a0ffc9ca8aa9a27740d11
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031551
(cherry picked from commit 9174561352)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3051589
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
c61a3c670f
commit
a6fc43ecb8
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
ifneq ($(CONFIG_TEGRA_GPIO_LEGACY_DISABLE),y)
|
ifneq ($(CONFIG_TEGRA_GPIO_LEGACY_DISABLE),y)
|
||||||
obj-m += cdi_gpio.o
|
obj-m += cdi_gpio.o
|
||||||
obj-m += cdi_mgr.o
|
|
||||||
endif
|
endif
|
||||||
|
obj-m += cdi_mgr.o
|
||||||
obj-m += cdi_dev.o
|
obj-m += cdi_dev.o
|
||||||
obj-m += cdi_pwm.o
|
obj-m += cdi_pwm.o
|
||||||
ifeq ($(findstring ack_src,$(NV_BUILD_KERNEL_OPTIONS)),)
|
ifeq ($(findstring ack_src,$(NV_BUILD_KERNEL_OPTIONS)),)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/of_irq.h>
|
#include <linux/of_irq.h>
|
||||||
|
#include <linux/of.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <asm/siginfo.h>
|
#include <asm/siginfo.h>
|
||||||
#include <linux/rcupdate.h>
|
#include <linux/rcupdate.h>
|
||||||
@@ -1329,13 +1330,22 @@ static int cdi_mgr_of_get_grp_gpio(
|
|||||||
{
|
{
|
||||||
int num, i;
|
int num, i;
|
||||||
|
|
||||||
|
#if defined(NV_OF_GPIO_NAMED_COUNT_PRESENT) /* Linux 6.2 */
|
||||||
num = of_gpio_named_count(np, name);
|
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);
|
dev_dbg(dev, " num gpios of %s: %d\n", name, num);
|
||||||
if (num < 0)
|
if (num < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; (i < num) && (i < size); i++) {
|
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]);
|
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) {
|
if ((int)grp[i] < 0) {
|
||||||
dev_err(dev, "%s: gpio[%d] invalid\n", __func__, i);
|
dev_err(dev, "%s: gpio[%d] invalid\n", __func__, i);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|||||||
Reference in New Issue
Block a user