Angel Pons | 560796c | 2020-04-03 01:22:52 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Piotr Król | dcd2f17 | 2016-05-27 12:04:13 +0200 | [diff] [blame] | 2 | |
Kyösti Mälkki | df84a28 | 2020-06-18 19:26:05 +0300 | [diff] [blame] | 3 | #include <gpio.h> |
Piotr Król | dcd2f17 | 2016-05-27 12:04:13 +0200 | [diff] [blame] | 4 | #include "gpio_ftns.h" |
| 5 | |
Kyösti Mälkki | c27df87 | 2017-01-16 19:58:53 +0200 | [diff] [blame] | 6 | int get_spd_offset(void) |
| 7 | { |
| 8 | u8 index = 0; |
Michał Żygowski | af258cc | 2019-12-01 17:42:04 +0100 | [diff] [blame] | 9 | /* |
| 10 | * One SPD file contains all 4 options, determine which index to |
Kyösti Mälkki | c27df87 | 2017-01-16 19:58:53 +0200 | [diff] [blame] | 11 | * read here, then call into the standard routines. |
| 12 | */ |
Kyösti Mälkki | df84a28 | 2020-06-18 19:26:05 +0300 | [diff] [blame] | 13 | if (gpio_get(GPIO_49)) |
| 14 | index |= 1 << 0; |
| 15 | if (gpio_get(GPIO_50)) |
| 16 | index |= 1 << 1; |
Kyösti Mälkki | c27df87 | 2017-01-16 19:58:53 +0200 | [diff] [blame] | 17 | |
| 18 | return index; |
| 19 | } |