Re: [PATCH 3/7] drivers: irqchip: add PDC irqdomain for wakeup capable GPIOs

From: Stephen Boyd
Date: Thu Dec 20 2018 - 15:19:43 EST


Quoting Lina Iyer (2018-12-19 14:11:01)
> diff --git a/drivers/irqchip/qcom-pdc-data.c b/drivers/irqchip/qcom-pdc-data.c
> new file mode 100644
> index 000000000000..99b4be0af5db
> --- /dev/null
> +++ b/drivers/irqchip/qcom-pdc-data.c
> @@ -0,0 +1,94 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
> + */
> +
> +#include "qcom-pdc.h"
> +
> +static const struct pdc_gpio_pin_map sdm845_gpio_pdc_map[] = {
> + { 1, 30 },
> + { 3, 31 },
> + { 5, 32 },
> + { 10, 33 },
> + { 11, 34 },
> + { 20, 35 },
> + { 22, 36 },
> + { 24, 37 },
> + { 26, 38 },
> + { 30, 39 },
> + { 31, 117 },
> + { 32, 41 },
> + { 34, 42 },
> + { 36, 43 },
> + { 37, 44 },
> + { 38, 45 },
> + { 39, 46 },
> + { 40, 47 },
> + { 41, 115 },
> + { 43, 49 },
> + { 44, 50 },
> + { 46, 51 },
> + { 48, 52 },
> + { 49, 118 },
> + { 52, 54 },
> + { 53, 55 },
> + { 54, 56 },
> + { 56, 57 },
> + { 57, 58 },
> + { 58, 59 },
> + { 59, 60 },
> + { 60, 61 },
> + { 61, 62 },
> + { 62, 63 },
> + { 63, 64 },
> + { 64, 65 },
> + { 66, 66 },
> + { 68, 67 },
> + { 71, 68 },
> + { 73, 69 },
> + { 77, 70 },
> + { 78, 71 },
> + { 79, 72 },
> + { 80, 73 },
> + { 84, 74 },
> + { 85, 75 },
> + { 86, 76 },
> + { 88, 77 },
> + { 89, 116 },
> + { 91, 79 },
> + { 92, 80 },
> + { 95, 81 },
> + { 96, 82 },
> + { 97, 83 },
> + { 101, 84 },
> + { 103, 85 },
> + { 104, 86 },
> + { 115, 90 },
> + { 116, 91 },
> + { 117, 92 },
> + { 118, 93 },
> + { 119, 94 },
> + { 120, 95 },
> + { 121, 96 },
> + { 122, 97 },
> + { 123, 98 },
> + { 124, 99 },
> + { 125, 100 },
> + { 127, 102 },
> + { 128, 103 },
> + { 129, 104 },
> + { 130, 105 },
> + { 132, 106 },
> + { 133, 107 },
> + { 145, 108 },
> +};
> +
> +static const struct pdc_gpio_pin_data sdm845_gpio_data = {
> + .size = ARRAY_SIZE(sdm845_gpio_pdc_map),
> + .map = sdm845_gpio_pdc_map,
> +};
> +
> +const struct of_device_id pdc_gpio_match_table[] = {
> + { .compatible = "qcom,845-pdc", .data = &sdm845_gpio_data },

Why not qcom,sdm845-pdc?

> + { },
> +};

I wonder why we wouldn't just put this all into the qcom-pdc.c file at
the bottom and then have that IRQCHIP_DECLARE() macros call small
functions that pass the pdc to gpio mapping table to qcom_pdc_init()
that takes a third argument?

I really hope that in the future all the gpios can be wakeup capable so
that we don't need to have the table at all!