[PATCH 1/5] Input: mtk-pmic-keys - Add kerneldoc to driver structures

AngeloGioacchino Del Regno
2022-05-20T12:51:59Z

To enhance human readability, add kerneldoc to all driver structs.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
drivers/input/keyboard/mtk-pmic-keys.c | 30 +++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index c31ab4368388..8e4fa7cd16e6 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -34,6 +34,13 @@
#define MTK_PMIC_HOMEKEY_INDEX 1
#define MTK_PMIC_MAX_KEY_COUNT 2

+/**
+ * struct mtk_pmic_keys_regs - PMIC keys per-key registers
+ * @deb_reg: Debounced key status register
+ * @deb_mask: Bitmask of this key in status register
+ * @intsel_reg: Interrupt selector register
+ * @intsel_mask: Bitmask of this key in interrupt selector
+ */
struct mtk_pmic_keys_regs {
u32 deb_reg;
u32 deb_mask;
@@ -50,6 +57,11 @@ struct mtk_pmic_keys_regs {
.intsel_mask = _intsel_mask, \
}

+/**
+ * struct mtk_pmic_regs - PMIC Keys registers
+ * @keys_regs: Specific key registers
+ * @pmic_rst_reg: PMIC Keys reset register
+ */
struct mtk_pmic_regs {
const struct mtk_pmic_keys_regs keys_regs[MTK_PMIC_MAX_KEY_COUNT];
u32 pmic_rst_reg;
@@ -85,15 +97,31 @@ static const struct mtk_pmic_regs mt6358_regs = {
.pmic_rst_reg = MT6358_TOP_RST_MISC,
};

+/**
+ * struct mtk_pmic_keys_info - PMIC Keys per-key params
+ * @keys: Pointer to main driver structure
+ * @regs: Register offsets/masks for this key
+ * @keycode: Key code for this key
+ * @irq: Keypress or press/release interrupt
+ * @irq_r: Key release interrupt (optional)
+ * @wakeup: Indicates whether to use this key as a wakeup source
+ */
struct mtk_pmic_keys_info {
struct mtk_pmic_keys *keys;
const struct mtk_pmic_keys_regs *regs;
unsigned int keycode;
int irq;
- int irq_r; /* optional: release irq if different */
+ int irq_r;
bool wakeup:1;
};

+/**
+ * struct mtk_pmic_keys - Main driver structure
+ * @input_dev: Input device pointer
+ * @dev: Device pointer
+ * @regmap: Regmap handle
+ * @keys: Per-key parameters
+ */
struct mtk_pmic_keys {
struct input_dev *input_dev;
struct device *dev;
--
2.35.1