lkml.org 
[lkml]   [2017]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 16/19] ASoC: tlv320aic31xx: Add short circuit detection support
On Wed, Nov 29, 2017 at 03:32:57PM -0600, Andrew F. Davis wrote:

> +static irqreturn_t aic31xx_irq(int irq, void *data)
> +{
> + struct aic31xx_priv *aic31xx = (struct aic31xx_priv *)data;

There is no need to cast away from void, doing so can only mask bugs.

> + ret = regmap_read(aic31xx->regmap, AIC31XX_INTRDACFLAG, &value);
> + if (ret) {
> + dev_err(dev, "Failed to read interrupt mask: %d\n", ret);
> + return IRQ_NONE;
> + }
> +
> + if (value & AIC31XX_HPLSCDETECT)
> + dev_err(dev, "Short circuit on Left output is detected\n");
> + if (value & AIC31XX_HPRSCDETECT)
> + dev_err(dev, "Short circuit on Right output is detected\n");
> +
> + return IRQ_HANDLED;

This will report the interrupt as handled even if we didn't see an
interrupt we understand which will break shared interrupt lines. At the
very least we should log other interrupt sources numerically.

> + if (aic31xx->irq > 0) {
> + regmap_update_bits(aic31xx->regmap, AIC31XX_GPIO1,
> + AIC31XX_GPIO1_FUNC_MASK,
> + AIC31XX_GPIO1_INT1 <<
> + AIC31XX_GPIO1_FUNC_SHIFT);

Is the interrupt only available on GPIO1?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-12-01 14:40    [W:0.275 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site