lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ED8E3B22081A4459DAC7699F3695FB701941AD6EC@SW-EX-MBX02.diasemi.com>
Date:   Tue, 5 Jun 2018 19:52:25 +0000
From:   Steve Twiss <stwiss.opensource@...semi.com>
To:     Marek Vasut <marek.vasut@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     Marek Vasut <marek.vasut+renesas@...il.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Lee Jones <lee.jones@...aro.org>,
        Mark Brown <broonie@...nel.org>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>,
        Support Opensource <Support.Opensource@...semi.com>
Subject: RE: [PATCH v3 07/10] mfd: da9063: Add custom IRQ map for DA9063L

Hi Marek,

Thanks.

On 02 June 2018 11:12, Marek Vasut wrote,

> Subject: [PATCH v3 07/10] mfd: da9063: Add custom IRQ map for DA9063L
> 
> While the datasheet for DA9063L (2v1, 23-Mar-2017) lists the RTC register
> block, the DA9063L does not have an RTC. Add custom IRQ map for DA9063L to
> ignore the Alarm and Tick IRQs from the PMIC.

I've added a request to remove the RTC references from the DA9063L datasheet.

Adding that first part to the sentence in the commit log: "While the datasheet for DA9063L
(2v1, 23-Mar-2017) lists the RTC register block" is just pointing out an ambiguity from the
datasheet since the it also identifies those registers in Table 102 on page 126 as
"Reserved".

I would like to suggest, the commit log entry: "Add custom IRQ map for DA9063L to ignore
the Alarm and Tick IRQs from the PMIC".

> Signed-off-by: Marek Vasut <marek.vasut+renesas@...il.com>
> Cc: Geert Uytterhoeven <geert+renesas@...der.be>
> Cc: Lee Jones <lee.jones@...aro.org>
> Cc: Mark Brown <broonie@...nel.org>
> Cc: Steve Twiss <stwiss.opensource@...semi.com>
> Cc: Wolfram Sang <wsa+renesas@...g-engineering.com>
> Cc: linux-renesas-soc@...r.kernel.org
> ---
> V3: New patch
> ---
>  drivers/mfd/da9063-irq.c | 55
> ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 53 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/da9063-irq.c b/drivers/mfd/da9063-irq.c
> index 5b406ecfc14a..b6a88861cc2e 100644
> --- a/drivers/mfd/da9063-irq.c
> +++ b/drivers/mfd/da9063-irq.c
> @@ -74,8 +74,55 @@ static const struct regmap_irq_chip da9063_irq_chip = {
>  	.init_ack_masked = true,
>  };
> 
> +static const struct regmap_irq da9063l_irqs[] = {
> +	/* DA9063 event A register */
> +	REGMAP_IRQ_REG(DA9063_IRQ_ONKEY,
> DA9063_REG_EVENT_A_OFFSET, DA9063_M_ONKEY),
> +	REGMAP_IRQ_REG(DA9063_IRQ_ADC_RDY,
> DA9063_REG_EVENT_A_OFFSET, DA9063_M_ADC_RDY),
> +	REGMAP_IRQ_REG(DA9063_IRQ_SEQ_RDY,
> DA9063_REG_EVENT_A_OFFSET, DA9063_M_SEQ_RDY),
> +	/* DA9063 event B register */
> +	REGMAP_IRQ_REG(DA9063_IRQ_WAKE,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_WAKE),
> +	REGMAP_IRQ_REG(DA9063_IRQ_TEMP,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_TEMP),
> +	REGMAP_IRQ_REG(DA9063_IRQ_COMP_1V2,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_COMP_1V2),
> +	REGMAP_IRQ_REG(DA9063_IRQ_LDO_LIM,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_LDO_LIM),
> +	REGMAP_IRQ_REG(DA9063_IRQ_REG_UVOV,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_UVOV),
> +	REGMAP_IRQ_REG(DA9063_IRQ_DVC_RDY,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_DVC_RDY),
> +	REGMAP_IRQ_REG(DA9063_IRQ_VDD_MON,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_VDD_MON),
> +	REGMAP_IRQ_REG(DA9063_IRQ_WARN,
> DA9063_REG_EVENT_B_OFFSET, DA9063_M_VDD_WARN),
> +	/* DA9063 event C register */
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI0, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI0),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI1, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI1),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI2, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI2),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI3, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI3),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI4, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI4),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI5, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI5),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI6, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI6),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI7, DA9063_REG_EVENT_C_OFFSET,
> DA9063_M_GPI7),
> +	/* DA9063 event D register */
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI8, DA9063_REG_EVENT_D_OFFSET,
> DA9063_M_GPI8),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI9, DA9063_REG_EVENT_D_OFFSET,
> DA9063_M_GPI9),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI10,
> DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI10),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI11,
> DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI11),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI12,
> DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI12),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI13,
> DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI13),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI14,
> DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI14),
> +	REGMAP_IRQ_REG(DA9063_IRQ_GPI15,
> DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI15),
> +};
> +
> +static const struct regmap_irq_chip da9063l_irq_chip = {
> +	.name = "da9063l-irq",
> +	.irqs = da9063l_irqs,
> +	.num_irqs = DA9063_NUM_IRQ,

Isn't the number of IRQs in the DA9063L different to the standard DA9063
because of the missing RTC?

Regards,
Steve

> +
> +	.num_regs = 4,
> +	.status_base = DA9063_REG_EVENT_A,
> +	.mask_base = DA9063_REG_IRQ_MASK_A,
> +	.ack_base = DA9063_REG_EVENT_A,
> +	.init_ack_masked = true,
> +};
> +
>  int da9063_irq_init(struct da9063 *da9063)
>  {
> +	struct regmap_irq_chip *irq_chip;
>  	int ret;
> 
>  	if (!da9063->chip_irq) {
> @@ -83,10 +130,14 @@ int da9063_irq_init(struct da9063 *da9063)
>  		return -EINVAL;
>  	}
> 
> +	if (da9063->type == PMIC_TYPE_DA9063)
> +		irq_chip = &da9063_irq_chip;
> +	else
> +		irq_chip = &da9063l_irq_chip;
> +
>  	ret = regmap_add_irq_chip(da9063->regmap, da9063->chip_irq,
>  			IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_SHARED,
> -			da9063->irq_base, &da9063_irq_chip,
> -			&da9063->regmap_irq);
> +			da9063->irq_base, irq_chip, &da9063->regmap_irq);
>  	if (ret) {
>  		dev_err(da9063->dev, "Failed to reguest IRQ %d: %d\n",
>  				da9063->chip_irq, ret);
> --
> 2.16.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ