OSDN Git Service

gpio: tegra186: Check GPIO pin permission before access.
authorPrathamesh Shete <pshete@nvidia.com>
Wed, 24 May 2023 10:50:21 +0000 (16:20 +0530)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 26 May 2023 12:29:00 +0000 (14:29 +0200)
commitb2b56a16323043b49dea915bc47408b30b91b0b6
treed55e1fe5d04bd9e7ef9ab8bc88b076fa8e2d68a8
parent6516c3d5d6161d81087c1e9c683480fd2597a0c3
gpio: tegra186: Check GPIO pin permission before access.

This change checks if we have the necessary permission to
access the GPIO. For devices that have support for virtualisation
we need to check both the TEGRA186_GPIO_VM_REG and the
TEGRA186_GPIO_SCR_REG registers. For device that do not have
virtualisation support for GPIOs we only need to check the
TEGRA186_GPIO_SCR_REG register.

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-tegra186.c