ASoC: rt5659: Enable IRQ output for GPIO1 pin
authorNicolin Chen <nicoleotsuka@gmail.com>
Wed, 24 Aug 2016 19:03:39 +0000 (12:03 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 1 Sep 2016 20:10:21 +0000 (21:10 +0100)
Since it's possible to have an IRQ without enabling JD3, the
GPIO1 pin then would remain its default GPIO function which
is set as an input direction (seeing from rt5659). Meanwhile,
CPU would also listen this connection via its own GPIO input:
      [input]          [input]
    CPU GPIO <--------> RT5659 GPIO1

The result for the IRQ on the CPU side will be unexpectable.

So this patch enables the IRQ output for GPIO1 pin any way
as long as there's an IRQ assigned from platform data or DT:
      [input]          [IRQ output]
    CPU GPIO <--------< RT5659 GPIO1

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5659.c

index 42c183f97c3135e7842e4d19629aeb7856cd39fc..952e80287b87a97fc79c2d85bd423f22fc3129e6 100644 (file)
@@ -4187,6 +4187,9 @@ static int rt5659_i2c_probe(struct i2c_client *i2c,
                if (ret)
                        dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret);
 
+               /* Enable IRQ output for GPIO1 pin any way */
+               regmap_update_bits(rt5659->regmap, RT5659_GPIO_CTRL_1,
+                                  RT5659_GP1_PIN_MASK, RT5659_GP1_PIN_IRQ);
        }
 
        return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5659,
This page took 0.037089 seconds and 5 git commands to generate.