ChromeOS: Add DECLARE_x_CROS_GPIOS()

Change-Id: I88406fa1b54312616e6717af3d924436dc4ff1a6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58899
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Kyösti Mälkki 2021-11-02 13:03:06 +02:00
parent f0be9e3472
commit 4ff218aa71
55 changed files with 73 additions and 290 deletions

View File

@ -18,9 +18,4 @@ int get_write_protect_state(void)
return 0;
}
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
/* No ChromeOS GPIOs */
*num = 0;
return NULL;
}
DECLARE_NO_CROS_GPIOS();

View File

@ -18,9 +18,4 @@ int get_write_protect_state(void)
return 0;
}
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
/* No ChromeOS GPIOs */
*num = 0;
return NULL;
}
DECLARE_NO_CROS_GPIOS();

View File

@ -19,12 +19,8 @@ void fill_lb_gpios(struct lb_gpios *gpios)
static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, "QEMU"),
};
DECLARE_CROS_GPIOS(cros_gpios);
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
int get_ec_is_trusted(void)
{

View File

@ -35,12 +35,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(CROS_WP_GPIO, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -69,12 +69,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(GPIO_REC_MODE, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -426,11 +426,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);
const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
{

View File

@ -445,11 +445,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);
const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
{

View File

@ -432,12 +432,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
{

View File

@ -52,12 +52,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AH(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AL(WP_GPIO, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -59,12 +59,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(0x10013, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -474,8 +474,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_COMM0_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -407,11 +407,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);
/* Weak implementation of overrides */
const struct pad_config *__weak variant_override_gpio_table(size_t *num)

View File

@ -254,11 +254,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPP_E15, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
void variant_mainboard_post_init_params(FSPM_UPD *mupd)
{

View File

@ -31,12 +31,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -264,8 +264,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -30,12 +30,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -22,12 +22,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_DEVICE_NAME),
CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -418,11 +418,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);
/* Weak implementation of overrides */
const struct pad_config *__weak override_gpio_table(size_t *num)

View File

@ -71,12 +71,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(GPIO_REC_MODE, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -29,12 +29,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_DEVICE_NAME),
CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -36,12 +36,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(GPIO_REC_MODE, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -382,8 +382,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(PAD_SCC(GPIO_PCH_WP), GPIO_COMM_SCC_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -50,12 +50,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AH(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AL(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -388,11 +388,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);
const struct pad_config * __weak variant_romstage_gpio_table(size_t *num)
{

View File

@ -42,12 +42,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(0x2006, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -398,8 +398,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_PE_AH(PAD_N(GPIO_SHIP_MODE), GPIO_COMM_N_NAME),
};
const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -409,8 +409,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_PE_AH(PAD_N(GPIO_SHIP_MODE), GPIO_COMM_N_NAME),
};
const struct cros_gpio * variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -259,8 +259,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPP_E15, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -247,8 +247,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPP_E15, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -19,9 +19,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_DEVICE_NAME),
CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -27,12 +27,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -79,8 +79,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AL(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -467,8 +467,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -28,12 +28,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, GPIO_DEVICE_NAME),
CROS_GPIO_WP_AL(CROS_WP_GPIO, GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -279,9 +279,4 @@ void variant_configure_gpio_pads(void)
static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -190,9 +190,4 @@ void variant_configure_gpio_pads(void)
static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -236,9 +236,4 @@ void variant_configure_gpio_pads(void)
static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -47,8 +47,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AL(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -609,8 +609,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -44,8 +44,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AL(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -263,8 +263,4 @@ variant_sleep_gpio_table(size_t *num)
static const struct cros_gpio cros_gpios[] = {
};
const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -109,8 +109,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -109,8 +109,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -351,8 +351,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_COMM0_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -59,12 +59,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -30,12 +30,7 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);
int get_ec_is_trusted(void)
{

View File

@ -349,8 +349,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *__weak variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_WEAK_CROS_GPIOS(cros_gpios);

View File

@ -38,8 +38,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(0x10013, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -136,8 +136,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -132,8 +132,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -36,8 +36,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -90,8 +90,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -83,8 +83,4 @@ static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_WP_AH(GPIO_SPI_WP, CROS_GPIO_DEVICE_NAME),
};
const struct cros_gpio *variant_cros_gpios(size_t *num)
{
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
DECLARE_CROS_GPIOS(cros_gpios);

View File

@ -12,7 +12,8 @@ void chromeos_acpi_gpio_generate(void)
size_t i, num;
int gpio_num;
gpios = variant_cros_gpios(&num);
num = variant_cros_gpio.count;
gpios = variant_cros_gpio.gpios;
if (!gpios)
return;

View File

@ -98,6 +98,23 @@ struct cros_gpio {
#define CROS_GPIO_PE_AH(num, dev) \
CROS_GPIO_PE_INITIALIZER(CROS_GPIO_ACTIVE_HIGH, num, dev)
const struct cros_gpio *variant_cros_gpios(size_t *num);
struct cros_gpio_pack {
int count;
const struct cros_gpio *gpios;
};
extern const struct cros_gpio_pack variant_cros_gpio;
#define DECLARE_NO_CROS_GPIOS() \
const struct cros_gpio_pack variant_cros_gpio = \
{ .count = 0, .gpios = NULL }
#define DECLARE_CROS_GPIOS(x) \
const struct cros_gpio_pack variant_cros_gpio = \
{ .count = ARRAY_SIZE(x), .gpios = x }
#define DECLARE_WEAK_CROS_GPIOS(x) \
const struct cros_gpio_pack __weak variant_cros_gpio = \
{ .count = ARRAY_SIZE(x), .gpios = x }
#endif /* __CHROMEOS_H__ */