tegra: correct gpio_index_to_port() calculation
The gpio_index_to_port() incorrectly was dividing by
GPIO_PORTS_PER_BANK on a value including the bit number. After
masking off the BANK offset just divide by the number of gpios
in a port to get the port offset.
BUG=chrome-os-partner:29981
BRANCH=None
TEST=Built and ran through to depthcharge. Printed bank, port, and
bit numbers for validation.
Change-Id: I8bb50e922c9fd7c0a1c247ba95394f6deb9f1533
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/210909
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
parent
4c020c2125
commit
97e1f830b4
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ static inline int gpio_index_to_bank(int index)
|
|||
|
||||
static inline int gpio_index_to_port(int index)
|
||||
{
|
||||
return (index % GPIO_GPIOS_PER_BANK) / GPIO_PORTS_PER_BANK;
|
||||
return (index % GPIO_GPIOS_PER_BANK) / GPIO_GPIOS_PER_PORT;
|
||||
}
|
||||
|
||||
static inline int gpio_to_bit(int index)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue