[PATCH v8 0/2] Fix jack detection for Chromebook Pixel

2019-06-18 Thread Fletcher Woodruff
Headphone/mic jack detection doesn't work on the Chromebook Pixel 2015. These patches change the irq implementation to support polarity flipping. With this series, plugging and unplugging the headphone jack switches between headphones and speakers automatically, and headset microphones are also

[PATCH v8 1/2] ASoC: rt5677: clear interrupts by polarity flip

2019-06-18 Thread Fletcher Woodruff
-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 173 ++ sound/soc/codecs/rt5677.h | 8 +- 2 files changed, 145 insertions(+), 36 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 87a92ba0d040b7

[PATCH v8 2/2] ASoC: rt5677: handle concurrent interrupts

2019-06-18 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 71

Re: [PATCH v7 3/4] ASoC: rt5677: clear interrupts by polarity flip

2019-06-18 Thread Fletcher Woodruff
On Sun, Jun 16, 2019 at 10:56 AM Cezary Rojewski wrote: > On 2019-06-14 21:48, Fletcher Woodruff wrote: > > +static irqreturn_t rt5677_irq(int unused, void *data) > > +{ > > + struct rt5677_priv *rt5677 = data; > > + int ret = 0, i, reg_irq, virq; >

[PATCH v7 4/4] ASoC: rt5677: handle concurrent interrupts

2019-06-14 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 67

[PATCH v7 3/4] ASoC: rt5677: clear interrupts by polarity flip

2019-06-14 Thread Fletcher Woodruff
-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 170 ++ sound/soc/codecs/rt5677.h | 7 +- 2 files changed, 143 insertions(+), 34 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 87a92ba0d040b7

[PATCH v7 1/4] ASoC: rt5677: fall back to DT prop names on error

2019-06-14 Thread Fletcher Woodruff
names first and fall back to the DT names on error. With this patch, plugging and unplugging the headphone jack switches between headphones and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37

[PATCH v7 2/4] ASoC: rt5677: move jack-detect init to i2c probe

2019-06-14 Thread Fletcher Woodruff
settings are controlling. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 60 ++- sound/soc/codecs/rt5677.h | 6 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc

[PATCH v7 0/4] Fix jack detection for Chromebook Pixel

2019-06-14 Thread Fletcher Woodruff
our own irq_chip. v2: - Split IRQ change into two patches: adding and fixing potential race - Change config reading code to try both DT and ACPI style names Ben Zhang (2): ASoC: rt5677: clear interrupts by polarity flip ASoC: rt5677: handle concurrent interrupts Fletcher Woodruff (2

[PATCH v6 1/4] ASoC: rt5677: fall back to DT prop names on error

2019-06-14 Thread Fletcher Woodruff
names first and fall back to the DT names on error. With this patch, plugging and unplugging the headphone jack switches between headphones and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37

[PATCH v6 0/4] Fix jack detection for Chromebook Pixel

2019-06-14 Thread Fletcher Woodruff
. v2: - Split IRQ change into two patches: adding and fixing potential race - Change config reading code to try both DT and ACPI style names Ben Zhang (2): ASoC: rt5677: clear interrupts by polarity flip ASoC: rt5677: handle concurrent interrupts Fletcher Woodruff (2): ASoC: rt5677

[PATCH v6 3/4] ASoC: rt5677: clear interrupts by polarity flip

2019-06-14 Thread Fletcher Woodruff
-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 170 ++ sound/soc/codecs/rt5677.h | 7 +- 2 files changed, 143 insertions(+), 34 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index b508fd9b7d4536

[PATCH v6 4/4] ASoC: rt5677: handle concurrent interrupts

2019-06-14 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 67

[PATCH v6 2/4] ASoC: rt5677: move jack-detect init to i2c probe

2019-06-14 Thread Fletcher Woodruff
settings are controlling. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 60 ++- sound/soc/codecs/rt5677.h | 6 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc

[PATCH v6 4/4] ASoC: rt5677: handle concurrent interrupts

2019-06-05 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 67

[PATCH v6 3/4] ASoC: rt5677: clear interrupts by polarity flip

2019-06-05 Thread Fletcher Woodruff
-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 169 ++ sound/soc/codecs/rt5677.h | 7 +- 2 files changed, 142 insertions(+), 34 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 65bef50ded1151

[PATCH v6 2/4] ASoC: rt5677: move jack-detect init to i2c probe

2019-06-05 Thread Fletcher Woodruff
settings are controlling. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 60 ++- sound/soc/codecs/rt5677.h | 6 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc

[PATCH v6 1/4] ASoC: rt5677: fall back to DT prop names on error

2019-06-05 Thread Fletcher Woodruff
names first and fall back to the DT names on error. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 9b7a1833d3316c

[PATCH v6 0/4] Fix jack detection for Chromebook Pixel

2019-06-05 Thread Fletcher Woodruff
patches: adding and fixing potential race - Change config reading code to try both DT and ACPI style names Ben Zhang (2): ASoC: rt5677: clear interrupts by polarity flip ASoC: rt5677: handle concurrent interrupts Fletcher Woodruff (2): ASoC: rt5677: fall back to DT prop names on error ASoC

[PATCH v5 1/3] ASoC: rt5677: allow multiple interrupt sources

2019-05-07 Thread Fletcher Woodruff
. Inside the handler, we will need to detect this, report the hotword event, and re-connect GPIO1 to the jack detection irq. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 256 -- sound/soc/codecs/rt5677.h | 14 ++- 2

[PATCH v5 2/3] ASoC: rt5677: handle concurrent interrupts

2019-05-07 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 84

[PATCH v5 3/3] ASoC: rt5677: fall back to DT prop names on error

2019-05-07 Thread Fletcher Woodruff
names first and fall back to the DT names on error. With this patch, plugging and unplugging the headphone jack switches between headphones and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37

[PATCH v5 0/3] Fix jack detection for Chromebook Pixel

2019-05-07 Thread Fletcher Woodruff
implement our own irq_chip. v2: - Split IRQ change into two patches: adding and fixing potential race - Change config reading code to try both DT and ACPI style names Ben Zhang (2): ASoC: rt5677: allow multiple interrupt sources ASoC: rt5677: handle concurrent interrupts Fletcher

[PATCH v4 0/3] Fix jack detection for Chromebook Pixel

2019-05-03 Thread Fletcher Woodruff
potential race - Change config reading code to try both DT and ACPI style names Ben Zhang (1): ASoC: rt5677: allow multiple interrupt sources Fletcher Woodruff (2): ASoC: rt5677: handle concurrent interrupts ASoC: rt5677: fall back to DT prop names on error sound/soc/codecs/rt5677.c | 346

[PATCH v4 1/3] ASoC: rt5677: allow multiple interrupt sources

2019-05-03 Thread Fletcher Woodruff
. Inside the handler, we will need to detect this, report the hotword event, and re-connect GPIO1 to the jack detection irq. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 256 -- sound/soc/codecs/rt5677.h | 14 ++- 2

[PATCH v4 2/3] ASoC: rt5677: handle concurrent interrupts

2019-05-03 Thread Fletcher Woodruff
loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 84 +++ 1 file

[PATCH v4 3/3] ASoC: rt5677: fall back to DT prop names on error

2019-05-03 Thread Fletcher Woodruff
names first and fall back to the DT names on error. With this patch, plugging and unplugging the headphone jack switches between headphones and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37

[PATCH v3 3/3] ASoC: rt5677: fall back to DT prop names on error

2019-04-25 Thread Fletcher Woodruff
names first and fall back to the DT names on error. With this patch, plugging and unplugging the headphone jack switches between headphones and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37

[PATCH v3 2/3] ASoC: rt5677: handle concurrent interrupts

2019-04-25 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 84

Re: [PATCH v3 0/3] Fix jack detection for Chromebook Pixel

2019-04-25 Thread Fletcher Woodruff
On Thu, Apr 18, 2019 at 3:07 AM Mark Brown wrote: > > I only have patch 1 here... Apologies, patches 2/3 were unchanged so I did not resend. I'll add them to the chain.

[PATCH v3 0/3] Fix jack detection for Chromebook Pixel

2019-04-15 Thread Fletcher Woodruff
both DT and ACPI style names Ben Zhang (2): ASoC: rt5677: allow multiple interrupt sources ASoC: rt5677: handle concurrent interrupts Fletcher Woodruff (1): ASoC: rt5677: fall back to DT prop names on error sound/soc/codecs/rt5677.c | 347 +++--- sound/soc

[PATCH v3 1/3] ASoC: rt5677: allow multiple interrupt sources

2019-04-15 Thread Fletcher Woodruff
. Inside the handler, we will need to detect this, report the hotword event, and re-connect GPIO1 to the jack detection irq. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 257 -- sound/soc/codecs/rt5677.h | 14 ++- 2

Re: [PATCH v2 1/3] ASoC: rt5677: allow multiple interrupt sources

2019-04-09 Thread Fletcher Woodruff
On Mon, Apr 8, 2019 at 12:38 AM Mark Brown wrote: > On Fri, Apr 05, 2019 at 02:42:55PM -0600, Fletcher Woodruff wrote: > > > This patch allows headphone plug detect and mic present > > detect to be enabled at the same time. This patch implements > > an irq_chip with irq

[PATCH v2 3/3] ASoC: rt5677: fall back to DT prop names on error

2019-04-05 Thread Fletcher Woodruff
names first and fall back to the DT names on error. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 74 +++ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 6bff0df53c6c6b

[PATCH v2 2/3] ASoC: rt5677: handle concurrent interrupts

2019-04-05 Thread Fletcher Woodruff
. Add a bounded loop to rt5677_irq that keeps checking interrupts until none are seen, so that any interrupts that are signalled in that interval are correctly handled. Signed-off-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 84

[PATCH v2 1/3] ASoC: rt5677: allow multiple interrupt sources

2019-04-05 Thread Fletcher Woodruff
-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 257 -- sound/soc/codecs/rt5677.h | 14 ++- 2 files changed, 204 insertions(+), 67 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 9b7a1833d3316c

[PATCH v2 0/3] Fix jack detection for Chromebook Pixel

2019-04-05 Thread Fletcher Woodruff
ASoC: rt5677: handle concurrent interrupts Fletcher Woodruff (1): ASoC: rt5677: fall back to DT prop names on error sound/soc/codecs/rt5677.c | 347 +++--- sound/soc/codecs/rt5677.h | 14 +- 2 files changed, 257 insertions(+), 104 deletions(-) -- 2.21.0.392

Re: [PATCH 1/2] ASoC: rt5677: allow multiple interrupt sources

2019-04-03 Thread Fletcher Woodruff
On Mon, Apr 1, 2019 at 11:02 PM Mark Brown wrote: > regmap-irq should support active high/low, and if it doesn't it can't be > a unique thing that only this device wants to implement so the common > code should be improved. The rt5677 driver needs its own irq regardless for hotword detection. If

Re: [PATCH 2/2] ASoC: rt5677: make ACPI property names match _DSD

2019-04-02 Thread Fletcher Woodruff
On Mon, Apr 1, 2019 at 11:06 PM Mark Brown wrote: > On Mon, Apr 01, 2019 at 02:55:19PM -0600, Fletcher Woodruff wrote: > > The rt5677 driver is using the wrong property names to read from ACPI. > > Update the property names to match those from _DSD, so that the correct >

[PATCH 2/2] ASoC: rt5677: make ACPI property names match _DSD

2019-04-01 Thread Fletcher Woodruff
and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 27 ++- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 33380f82b7008f..1f725086cee39c 100644 --- a/sound/soc

[PATCH 1/2] ASoC: rt5677: allow multiple interrupt sources

2019-04-01 Thread Fletcher Woodruff
-by: Ben Zhang Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 261 -- sound/soc/codecs/rt5677.h | 14 +- 2 files changed, 208 insertions(+), 67 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 9b7a1833d3316c