[PATCH] ASoC: tlv320aic3x: Add support for tlv320aic3104

2015-01-30 Thread Jyri Sarha
Disables GPIO support and LINE2 input and renames Mic3 input to Mic2,
if tlv320aic3104 mode is seleced. Devicetree binding document is
updated accordingly.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 .../devicetree/bindings/sound/tlv320aic3x.txt  |   10 +-
 sound/soc/codecs/tlv320aic3x.c |  344 ++--
 2 files changed, 252 insertions(+), 102 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt 
b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
index 5e6040c..47a213c 100644
--- a/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
+++ b/Documentation/devicetree/bindings/sound/tlv320aic3x.txt
@@ -9,6 +9,7 @@ Required properties:
 ti,tlv320aic33 - TLV320AIC33
 ti,tlv320aic3007 - TLV320AIC3007
 ti,tlv320aic3106 - TLV320AIC3106
+ti,tlv320aic3104 - TLV320AIC3104
 
 
 - reg - int -  I2C slave address
@@ -18,6 +19,7 @@ Optional properties:
 
 - gpio-reset - gpio pin number used for codec reset
 - ai3x-gpio-func - array of 2 int - AIC3X_GPIO1  AIC3X_GPIO2 Functionality
+   - Not supported on tlv320aic3104
 - ai3x-micbias-vg - MicBias Voltage required.
1 - MICBIAS output is powered to 2.0V,
2 - MICBIAS output is powered to 2.5V,
@@ -36,7 +38,13 @@ CODEC output pins:
   * HPLCOM
   * HPRCOM
 
-CODEC input pins:
+CODEC input pins for TLV320AIC3104:
+  * MIC2L
+  * MIC2R
+  * LINE1L
+  * LINE1R
+
+CODEC input pins for other compatible codecs:
   * MIC3L
   * MIC3R
   * LINE1L
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index b7ebce0..49ba3c7 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -87,6 +87,7 @@ struct aic3x_priv {
 #define AIC3X_MODEL_3X 0
 #define AIC3X_MODEL_33 1
 #define AIC3X_MODEL_3007 2
+#define AIC3X_MODEL_3104 3
u16 model;
 
/* Selects the micbias voltage */
@@ -316,52 +317,37 @@ static const struct snd_kcontrol_new aic3x_snd_controls[] 
= {
 * only for swapped L-to-R and R-to-L routes. See below stereo controls
 * for direct L-to-L and R-to-R routes.
 */
-   SOC_SINGLE_TLV(Left Line Mixer Line2R Bypass Volume,
-  LINE2R_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Left Line Mixer PGAR Bypass Volume,
   PGAR_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Left Line Mixer DACR1 Playback Volume,
   DACR1_2_LLOPM_VOL, 0, 118, 1, output_stage_tlv),
 
-   SOC_SINGLE_TLV(Right Line Mixer Line2L Bypass Volume,
-  LINE2L_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Right Line Mixer PGAL Bypass Volume,
   PGAL_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Right Line Mixer DACL1 Playback Volume,
   DACL1_2_RLOPM_VOL, 0, 118, 1, output_stage_tlv),
 
-   SOC_SINGLE_TLV(Left HP Mixer Line2R Bypass Volume,
-  LINE2R_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Left HP Mixer PGAR Bypass Volume,
   PGAR_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Left HP Mixer DACR1 Playback Volume,
   DACR1_2_HPLOUT_VOL, 0, 118, 1, output_stage_tlv),
 
-   SOC_SINGLE_TLV(Right HP Mixer Line2L Bypass Volume,
-  LINE2L_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Right HP Mixer PGAL Bypass Volume,
   PGAL_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Right HP Mixer DACL1 Playback Volume,
   DACL1_2_HPROUT_VOL, 0, 118, 1, output_stage_tlv),
 
-   SOC_SINGLE_TLV(Left HPCOM Mixer Line2R Bypass Volume,
-  LINE2R_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Left HPCOM Mixer PGAR Bypass Volume,
   PGAR_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Left HPCOM Mixer DACR1 Playback Volume,
   DACR1_2_HPLCOM_VOL, 0, 118, 1, output_stage_tlv),
 
-   SOC_SINGLE_TLV(Right HPCOM Mixer Line2L Bypass Volume,
-  LINE2L_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Right HPCOM Mixer PGAL Bypass Volume,
   PGAL_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
SOC_SINGLE_TLV(Right HPCOM Mixer DACL1 Playback Volume,
   DACL1_2_HPRCOM_VOL, 0, 118, 1, output_stage_tlv),
 
/* Stereo output controls for direct L-to-L and R-to-R routes */
-   SOC_DOUBLE_R_TLV(Line Line2 Bypass Volume,
-LINE2L_2_LLOPM_VOL, LINE2R_2_RLOPM_VOL,
-0, 118, 1, output_stage_tlv),
SOC_DOUBLE_R_TLV(Line PGA Bypass Volume,
 PGAL_2_LLOPM_VOL, PGAR_2_RLOPM_VOL,
 0, 118, 1, output_stage_tlv),
@@ -369,9 +355,6 @@ static 

Re: [PATCH v3 0/5] Add support for Fujitsu USB host controller

2015-01-30 Thread Felipe Balbi
Hi,

On Thu, Jan 29, 2015 at 10:23:12AM -0600, Felipe Balbi wrote:
 On Tue, Jan 27, 2015 at 09:22:50AM -0600, Felipe Balbi wrote:
  Hi,
  
  On Sun, Jan 25, 2015 at 04:13:23PM +0800, Sneeker Yeh wrote:
   These patches add support for XHCI compliant Host controller found
   on Fujitsu Socs, and are based on http://lwn.net/Articles/629162/
   The first patch is to add Fujitsu glue layer of Synopsis DesignWare USB3 
   driver
   and last four patch is about quirk implementation of errata in Synopsis
   DesignWare USB3 IP.
   
   Patch 1 introduces a quirk with device disconnection management necessary
   Synopsys Designware USB3 IP with versions  3.00a and hardware 
   configuration
   DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1. It solves a problem where without the
   quirk, that host controller will die after a usb device is disconnected 
   from
   port of root hub.
   
   Patch 2 is to set Synopsis quirk in xhci platform driver based on xhci 
   platform
   data.
   
   Patch 3 is to add a revison number 2.90a and 3.00a of Synopsis DesignWare 
   USB3
   IP core driver.
   
   Patch 4 introduces using a quirk based on a errata of Synopsis
   DesignWare USB3 IP which is versions  3.00a and has hardware 
   configuration
   DWC_USB3_SUSPEND_ON_DISCONNECT_EN=1, which cannot be read from software. 
   As a
   result this quirk has to be enabled via platform data or device tree.
   
   Patch 5 introduces Fujitsu Specific Glue layer in Synopsis DesignWare 
   USB3 IP
   driver. 
   
  
  Mathias, let me know how you want to handle this. Either I take them
  all, or you take them all. What do you prefer ?
 
 Mathias ?

Mathias, a reminder on this series.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 00/11] ARM: OMAP3: legacy clock data move under clk driver

2015-01-30 Thread Tero Kristo

On 01/30/2015 02:42 AM, Mike Turquette wrote:

Quoting Tero Kristo (2015-01-29 12:19:29)

On 01/08/2015 01:00 AM, Tony Lindgren wrote:

* Tero Kristo t-kri...@ti.com [141216 08:22]:

Hi,

These patches move the legacy clock data for omap3 under drivers/clk/ti.
After these patches are applied, it should be possible to get rid of
clk-private.h (long pending project for Mike.)

Testing done (on top of 3.18-rc1):

omap3-beagle: boot / suspend-resume (ret/off) / cpuidle (ret/off)
omap3-beagle-xm: boot upto fs mount (see note below)
sdp3430: boot
n900: boot

Note: beagle-xm failed with FS mount on the board I have access to, but
this happens with clean 3.18-rc1 and linux-next also at the moment.
The board has probably corrupted filesystem image but I am unable
to fix this atm (remote board.)

Test branch:
tree: https://github.com/t-kristo/linux-pm.git
branch: 3.18-rc1-omap3-clk-rework


Great, hopefully this will finally allow Mike to make the
generic struct clk private to drivers/clk :)

Seems to boot just fine based on a quick legacy booting test
on n900.

Mike, assuming no other issues, can you please apply these into a
immutable branch against v3.19-rc1 that Paul and I can also merge
in as needed?

Please also feel free to add:

Acked-by: Tony Lindgren t...@atomide.com



I just rebased these patches on top of 3.19-rc1, and noticed a problem
with dpll5 on beagle-xm (basically a divide-by-zero error + locking
issue during boot.) The extra diff at the end of this email fixes the
problems, I will also send the updated two patches as v2. Updated branch
available in my tree under name 3.19-rc1-omap3-clk-rework.


I've applied these 11 patches on top of v3.19-rc1, including the two V2
patches for #6 and #8 to the clk-omap-legacy branch here:

git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-omap-legacy

Let me know if I screwed anything up. I've merged this immutable branch
into clk-next.

In addition I've made some changes to remove clk-private.h permanently.
I'll post those later today. Again, please let me know if I screwed
anything up.


I can't see the clk-omap-legacy merged to clk-next so far, maybe you did 
not push it yet? The branch itself is identical copy of mine, so can't 
see any issues there so far.


-Tero



Regards,
Mike



- Tero

-

diff --git a/drivers/clk/ti/clk-3xxx-legacy.c
b/drivers/clk/ti/clk-3xxx-legacy.c
index 81ad510..e0732a4 100644
--- a/drivers/clk/ti/clk-3xxx-legacy.c
+++ b/drivers/clk/ti/clk-3xxx-legacy.c
@@ -136,6 +136,7 @@ static struct ti_clk_dpll dpll3_ck_data = {
 .idlest_mask = 0x1,
 .auto_recal_bit = 0x3,
 .max_divider = 0x80,
+   .min_divider = 0x1,
 .recal_en_bit = 0x5,
 .max_multiplier = 0x7ff,
 .enable_mask = 0x7,
@@ -307,6 +308,7 @@ static struct ti_clk_dpll dpll4_ck_data = {
 .idlest_mask = 0x2,
 .auto_recal_bit = 0x13,
 .max_divider = 0x80,
+   .min_divider = 0x1,
 .recal_en_bit = 0x6,
 .max_multiplier = 0x7ff,
 .enable_mask = 0x7,
@@ -507,6 +509,7 @@ static struct ti_clk_dpll dpll5_ck_data = {
 .idlest_mask = 0x1,
 .auto_recal_bit = 0x3,
 .max_divider = 0x80,
+   .min_divider = 0x1,
 .recal_en_bit = 0x19,
 .max_multiplier = 0x7ff,
 .enable_mask = 0x7,
@@ -1271,6 +1274,7 @@ static struct ti_clk_dpll dpll1_ck_data = {
 .idlest_mask = 0x1,
 .auto_recal_bit = 0x3,
 .max_divider = 0x80,
+   .min_divider = 0x1,
 .recal_en_bit = 0x7,
 .max_multiplier = 0x7ff,
 .enable_mask = 0x7,
@@ -2154,6 +2158,7 @@ static struct ti_clk_dpll dpll2_ck_data = {
 .idlest_mask = 0x1,
 .auto_recal_bit = 0x3,
 .max_divider = 0x80,
+   .min_divider = 0x1,
 .recal_en_bit = 0x8,
 .max_multiplier = 0x7ff,
 .enable_mask = 0x7,
@@ -2513,6 +2518,7 @@ static struct ti_clk_dpll dpll4_ck_omap36xx_data = {
 .idlest_mask = 0x2,
 .auto_recal_bit = 0x13,
 .max_divider = 0x80,
+   .min_divider = 0x1,
 .recal_en_bit = 0x6,
 .max_multiplier = 0xfff,
 .enable_mask = 0x7,
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index 8d9c603..404158d 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -148,6 +148,7 @@ struct ti_clk_dpll {
 u32 sddiv_mask;
 u16 max_multiplier;
 u16 max_divider;
+   u8 min_divider;
 u8 auto_recal_bit;
 u8 recal_en_bit;
 u8 recal_st_bit;
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 7d67639..47ebff7 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -243,6 +243,7 @@ struct clk *ti_clk_register_dpll(struct ti_clk *setup)
 dd-sddiv_mask = dpll-sddiv_mask;
 dd-dco_mask = dpll-dco_mask;
 dd-max_divider = dpll-max_divider;
+   dd-min_divider = dpll-min_divider;
 

[PATCH] arm: config: omap2plus_defconfig: switch over to LZMA compression

2015-01-30 Thread Felipe Balbi
LZMA compression makes about 33% smaller zImage
with just a slight extra decompression time.

Before this patch, zImage built with o2+_dc
is 4.5MiB and after it's about 3.3MiB.

Suggested-by: David Cohen david.a.co...@linux.intel.com
Signed-off-by: Felipe Balbi ba...@ti.com
---
 arch/arm/configs/omap2plus_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/omap2plus_defconfig 
b/arch/arm/configs/omap2plus_defconfig
index b7386524c356..742c62b6d663 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -1,3 +1,4 @@
+CONFIG_KERNEL_LZMA=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_FHANDLE=y
-- 
2.3.0-rc1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] mmc: core: allow non-blocking form of mmc_claim_host

2015-01-30 Thread NeilBrown
Change the handling for the 'abort' flag so that if
it is set, but we can claim the host, then do the claim,
rather than aborting.

When the abort is async this just means that a race between aborting
an allowing a claim is resolved slightly differently.  Any
code must already be able to handle 'abort' being set just as the host
is claimed.

This allows extra functionality.  If __mmc_claim_host() is called
with an 'abort' pointer which is initialized to '1', it will effect a
non-blocking 'claim'.

Signed-off-by: NeilBrown n...@brown.name
---
 drivers/mmc/core/core.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index e9eb721e3664..051198073d21 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -912,10 +912,11 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t 
*abort)
spin_lock_irqsave(host-lock, flags);
}
set_current_state(TASK_RUNNING);
-   if (!stop) {
+   if (!host-claimed || host-claimer == current) {
host-claimed = 1;
host-claimer = current;
host-claim_cnt += 1;
+   stop = 0;
} else
wake_up(host-wq);
spin_unlock_irqrestore(host-lock, flags);


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] mmc: omap_hsmmc: switch to 1-bit before stopping clocks.

2015-01-30 Thread NeilBrown
Make use of the new mmc_sdio_want_no_clocks() call to avoid stopping
clocks while SD Card interrupts are enabled and we aren't in
1-bit mode.

Also stop clocks immediately in omap_hsmmc_disable_fclk() if
1-bit mode has been entered for this purpose.

With this, I can use my libertas wifi with a 4-bit bus, with
interrupts and runtime power-management enabled, and get around
14Mb/sec throughput (which is the best I've seen).

Signed-off-by: NeilBrown n...@brown.name
---
 drivers/mmc/host/omap_hsmmc.c |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index f84cfb01716d..14fce3b92633 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1791,9 +1791,12 @@ static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
 {
struct omap_hsmmc_host *host = mmc_priv(mmc);
 
-   pm_runtime_mark_last_busy(host-dev);
-   pm_runtime_put_autosuspend(host-dev);
-
+   if (atomic_read(mmc-sdio_narrowed) == 2)
+   pm_runtime_put_sync(host-dev);
+   else {
+   pm_runtime_mark_last_busy(host-dev);
+   pm_runtime_put_autosuspend(host-dev);
+   }
return 0;
 }
 
@@ -2311,6 +2314,10 @@ static int omap_hsmmc_runtime_suspend(struct device *dev)
spin_lock_irqsave(host-irq_lock, flags);
if ((host-mmc-caps  MMC_CAP_SDIO_IRQ) 
(host-flags  HSMMC_SDIO_IRQ_ENABLED)) {
+   if (mmc_sdio_want_no_clocks(host-mmc) == 0) {
+   ret = -EBUSY;
+   goto abort;
+   }
/* disable sdio irq handling to prevent race */
OMAP_HSMMC_WRITE(host-base, ISE, 0);
OMAP_HSMMC_WRITE(host-base, IE, 0);


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus.

2015-01-30 Thread NeilBrown
Every call to sdio_enable_4bit_bus is followed (on success) but a call
to mmc_set_bus_width().

To simplify the code, include those calls directly in
sdio_enable_4bit_bus().

Signed-off-by: NeilBrown n...@brown.name
---
 drivers/mmc/core/sdio.c |   32 
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index ce6cc47206b0..5bc6c7dbbd60 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -293,19 +293,22 @@ static int sdio_enable_4bit_bus(struct mmc_card *card)
int err;
 
if (card-type == MMC_TYPE_SDIO)
-   return sdio_enable_wide(card);
-
-   if ((card-host-caps  MMC_CAP_4_BIT_DATA) 
-   (card-scr.bus_widths  SD_SCR_BUS_WIDTH_4)) {
+   err = sdio_enable_wide(card);
+   else if ((card-host-caps  MMC_CAP_4_BIT_DATA) 
+(card-scr.bus_widths  SD_SCR_BUS_WIDTH_4)) {
err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4);
if (err)
return err;
+   err = sdio_enable_wide(card);
+   if (err = 0)
+   mmc_app_set_bus_width(card, MMC_BUS_WIDTH_1);
} else
return 0;
 
-   err = sdio_enable_wide(card);
-   if (err = 0)
-   mmc_app_set_bus_width(card, MMC_BUS_WIDTH_1);
+   if (err  0) {
+   mmc_set_bus_width(card-host, MMC_BUS_WIDTH_4);
+   err = 0;
+   }
 
return err;
 }
@@ -547,13 +550,8 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card)
/*
 * Switch to wider bus (if supported).
 */
-   if (card-host-caps  MMC_CAP_4_BIT_DATA) {
+   if (card-host-caps  MMC_CAP_4_BIT_DATA)
err = sdio_enable_4bit_bus(card);
-   if (err  0) {
-   mmc_set_bus_width(card-host, MMC_BUS_WIDTH_4);
-   err = 0;
-   }
-   }
 
/* Set the driver strength for the card */
sdio_select_driver_type(card);
@@ -803,9 +801,7 @@ try_again:
 * Switch to wider bus (if supported).
 */
err = sdio_enable_4bit_bus(card);
-   if (err  0)
-   mmc_set_bus_width(card-host, MMC_BUS_WIDTH_4);
-   else if (err)
+   if (err)
goto remove;
}
 finish:
@@ -983,10 +979,6 @@ static int mmc_sdio_resume(struct mmc_host *host)
} else if (mmc_card_keep_power(host)  mmc_card_wake_sdio_irq(host)) {
/* We may have switched to 1-bit mode during suspend */
err = sdio_enable_4bit_bus(host-card);
-   if (err  0) {
-   mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
-   err = 0;
-   }
}
 
if (!err  host-sdio_irqs) {


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] mmc: sdio: support switching to 1-bit before turning off clocks

2015-01-30 Thread NeilBrown
According to section 7.1.2 of

http://www.sandisk.com/media/File/OEM/Manuals/SD_SDIO_specsv1.pdf

In the case where the interrupt mechanism is used to wake the host while
the card is in a low power state (i.e. no clocks), Both the card and the
host shall be placed into the 1-bit SD mode prior to stopping the clock.


This is particularly important for the Marvell libertas wifi chip
in the GTA04.  While in 4-bit mode it will only signal an interrupt
when the clock is running (which is why setting CLKEXTFREE is
important in omap_hsmmc).
In 1-bit mode, the interrupt is asynchronous (explained in OMAP3
TRM description of the CIRQ flag to MMCHS_STAT:

  In 1-bit mode, interrupt source is asynchronous (can be a source of
  asynchronous wakeup).
  In 4-bit mode, interrupt source is sampled during the interrupt
  cycle.

)

It is awkward to simply set 1-bit mode in -runtime_suspend
as that will call mmc_set_ios which calls ops-set_ios(),
which will likely call pm_runtime_get_sync(), on the device that
is currently suspending.  This deadlocks.

So:
 - create a work_struct to schedule setting of 1-bit mode
 - introduce an 'sdio_narrowed' state flag which transitions:
 0 (normal) - 1 (convert to 1-bit pending) -
 2 (have switch to 1-bit mode) - 0 (normal)
 - create a function mmc_sdio_want_no_clocks() which can be called
   when the driver wants to turn off clocks (presumably after an
   idle timeout).  This either succeeds (in 1-bit mode) or fails
   and schedules the work to switch to 1-bit mode.
 - when the host is claimed, if sdio_narrowed is 2, restore the
   4-bit bus
 - When the host is released, if sdio_narrowed is 1, then some
   caller other  than our worker claimed the host first, so
   clear sdio_narrowed.

This all allows a graceful and race-free switch to 1-bit mode
before switching off the clocks, if SDIO interrupts are enabled.

A host should call mmc_sdio_want_no_clocks() when about to turn of
clocks if sdio interrupts are enabled, and the -disable() function
should not use a timeout (pm_runtime_put_autosuspend) if
-sdio_narrowed is 2.

Signed-off-by: NeilBrown n...@brown.name
---
 drivers/mmc/core/core.c  |   18 ++
 drivers/mmc/core/sdio.c  |   42 +-
 include/linux/mmc/core.h |2 ++
 include/linux/mmc/host.h |2 ++
 4 files changed, 59 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 051198073d21..21068fe75c30 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -921,8 +921,14 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t 
*abort)
wake_up(host-wq);
spin_unlock_irqrestore(host-lock, flags);
remove_wait_queue(host-wq, wait);
-   if (host-ops-enable  !stop  host-claim_cnt == 1)
-   host-ops-enable(host);
+   if (!stop  host-claim_cnt == 1) {
+   if (host-ops-enable)
+   host-ops-enable(host);
+   if (atomic_read(host-sdio_narrowed) == 2) {
+   sdio_enable_4bit_bus(host-card);
+   atomic_set(host-sdio_narrowed, 0);
+   }
+   }
return stop;
 }
 
@@ -941,8 +947,12 @@ void mmc_release_host(struct mmc_host *host)
 
WARN_ON(!host-claimed);
 
-   if (host-ops-disable  host-claim_cnt == 1)
-   host-ops-disable(host);
+   if (host-claim_cnt == 1) {
+   if (atomic_read(host-sdio_narrowed) == 1)
+   atomic_set(host-sdio_narrowed, 0);
+   if (host-ops-disable)
+   host-ops-disable(host);
+   }
 
spin_lock_irqsave(host-lock, flags);
if (--host-claim_cnt) {
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 5bc6c7dbbd60..9761e4d5f49b 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -288,7 +288,7 @@ static int sdio_disable_wide(struct mmc_card *card)
 }
 
 
-static int sdio_enable_4bit_bus(struct mmc_card *card)
+int sdio_enable_4bit_bus(struct mmc_card *card)
 {
int err;
 
@@ -313,6 +313,45 @@ static int sdio_enable_4bit_bus(struct mmc_card *card)
return err;
 }
 
+static void mmc_sdio_width_work(struct work_struct *work)
+{
+   struct mmc_host *host = container_of(work, struct mmc_host,
+sdio_width_work);
+   atomic_t noblock;
+
+   atomic_set(noblock, 1);
+   if (__mmc_claim_host(host, noblock))
+   return;
+   if (atomic_read(host-sdio_narrowed) != 1) {
+   /* Nothing to do */
+   mmc_release_host(host);
+   return;
+   }
+   if (sdio_disable_wide(host-card) == 0)
+   atomic_set(host-sdio_narrowed, 2);
+   else
+   atomic_set(host-sdio_narrowed, 0);
+   mmc_release_host(host);
+}
+
+int mmc_sdio_want_no_clocks(struct mmc_host *host)
+{
+   if (!(host-caps  MMC_CAP_SDIO_IRQ) ||

Re: [PATCH] ARM: dst: OMAP3-N900: Add microphone bias voltages

2015-01-30 Thread Pavel Machek
On Fri 2015-01-30 21:23:20, Jarkko Nikula wrote:
 From: Pavel Machek pa...@ucw.cz
 
 N900 audio recording needs that codec provides bias voltage for integrated
 digital microphone and headset microphone depending which one is used.
 Digital microphone uses 2 V bias and it comes from the codec A part. Codec
 B part drives the headset microphone bias and that is set to 2.5 V.
 
 Signed-off-by: Pavel Machek pa...@ucw.cz
 [Jarkko: Headset mic bias changed to 2 (2.5 V) as it was before commit
 e2e8bfdf6157 (ASoC: tlv320aic3x: Convert mic bias to a supply widget)]
 Signed-off-by: Jarkko Nikula jarkko.nik...@bitmer.com
 ---
 Pavel: I hope you don't mind I took your diff from
 http://marc.info/?l=linux-kernelm=142249383224678w=2
 and added your Signed-off-by?

No problem, my patches are GPLed. Thanks!
Pavel


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] arm: omap2+ remove dead clock code

2015-01-30 Thread Michael Turquette
Remove omap_clocks_register and dummy_ck. The former is not used anymore
now that the statically defined clk stuctures are replaced with proper
descriptors and registered with the framework.

The dummy clock in arch/arm/mach-omap2 is made redundant by the OMAP3+
clock data that migrated to drivers/clk.

An additional benefit to this clean-up is removing the references to
clk-private.h which will be removed.

Cc: Paul Walmsley p...@pwsan.com
Cc: Tero Kristo t-kri...@ti.com
Cc: Tony Lindgren t...@atomide.com
Signed-off-by: Michael Turquette mturque...@linaro.org
---
Cc: linux-omap@vger.kernel.org
 arch/arm/mach-omap2/clock.c | 16 
 arch/arm/mach-omap2/clock.h |  5 -
 arch/arm/mach-omap2/clock_common_data.c | 14 --
 3 files changed, 35 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6ad5b4d..d9c128e 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -23,7 +23,6 @@
 #include linux/clk-provider.h
 #include linux/io.h
 #include linux/bitops.h
-#include linux/clk-private.h
 #include asm/cpu.h
 
 #include trace/events/power.h
@@ -630,21 +629,6 @@ const struct clk_hw_omap_ops clkhwops_wait = {
 };
 
 /**
- * omap_clocks_register - register an array of omap_clk
- * @ocs: pointer to an array of omap_clk to register
- */
-void __init omap_clocks_register(struct omap_clk oclks[], int cnt)
-{
-   struct omap_clk *c;
-
-   for (c = oclks; c  oclks + cnt; c++) {
-   clkdev_add(c-lk);
-   if (!__clk_init(NULL, c-lk.clk))
-   omap2_init_clk_hw_omap_clocks(c-lk.clk);
-   }
-}
-
-/**
  * omap2_clk_switch_mpurate_at_boot - switch ARM MPU rate by boot-time argument
  * @mpurate_ck_name: clk name of the clock to change rate
  *
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index c5b3a7f..6a10ce3 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -245,7 +245,6 @@ struct ti_clk_features {
 extern struct ti_clk_features ti_clk_features;
 
 extern const struct clkops clkops_omap2_dflt_wait;
-extern const struct clkops clkops_dummy;
 extern const struct clkops clkops_omap2_dflt;
 
 extern struct clk_functions omap2_clk_functions;
@@ -254,8 +253,6 @@ extern const struct clksel_rate gpt_32k_rates[];
 extern const struct clksel_rate gpt_sys_rates[];
 extern const struct clksel_rate gfx_l3_rates[];
 extern const struct clksel_rate dsp_ick_rates[];
-extern struct clk_core dummy_ck_core;
-extern struct clk dummy_ck;
 
 extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
 extern const struct clk_hw_omap_ops clkhwops_wait;
@@ -280,7 +277,5 @@ extern void __iomem *clk_memmaps[];
 extern int omap2_clkops_enable_clkdm(struct clk_hw *hw);
 extern void omap2_clkops_disable_clkdm(struct clk_hw *hw);
 
-extern void omap_clocks_register(struct omap_clk *oclks, int cnt);
-
 void __init ti_clk_init_features(void);
 #endif
diff --git a/arch/arm/mach-omap2/clock_common_data.c 
b/arch/arm/mach-omap2/clock_common_data.c
index febd0a2..61b60df 100644
--- a/arch/arm/mach-omap2/clock_common_data.c
+++ b/arch/arm/mach-omap2/clock_common_data.c
@@ -16,7 +16,6 @@
  * OMAP3xxx clock definition files.
  */
 
-#include linux/clk-private.h
 #include clock.h
 
 /* clksel_rate data common to 24xx/343x */
@@ -114,16 +113,3 @@ const struct clksel_rate div31_1to31_rates[] = {
{ .div = 31, .val = 31, .flags = RATE_IN_4430 | RATE_IN_AM33XX },
{ .div = 0 },
 };
-
-/* Clocks shared between various OMAP SoCs */
-
-static struct clk_ops dummy_ck_ops = {};
-
-struct clk_core dummy_ck_core = {
-   .name = dummy_clk,
-   .ops = dummy_ck_ops,
-   .flags = CLK_IS_BASIC,
-};
-struct clk dummy_ck = {
-   .core = dummy_ck_core,
-};
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] arm: omap2+ remove dead clock code

2015-01-30 Thread Tony Lindgren
* Michael Turquette mturque...@linaro.org [150130 13:28]:
 Remove omap_clocks_register and dummy_ck. The former is not used anymore
 now that the statically defined clk stuctures are replaced with proper
 descriptors and registered with the framework.
 
 The dummy clock in arch/arm/mach-omap2 is made redundant by the OMAP3+
 clock data that migrated to drivers/clk.
 
 An additional benefit to this clean-up is removing the references to
 clk-private.h which will be removed.

Right on! Assuming things sitll build and boot, please feel free to
apply this via your clock patches:

Acked-by: Tony Lindgren t...@atomide.com
 
 Cc: Paul Walmsley p...@pwsan.com
 Cc: Tero Kristo t-kri...@ti.com
 Cc: Tony Lindgren t...@atomide.com
 Signed-off-by: Michael Turquette mturque...@linaro.org
 ---
 Cc: linux-omap@vger.kernel.org
  arch/arm/mach-omap2/clock.c | 16 
  arch/arm/mach-omap2/clock.h |  5 -
  arch/arm/mach-omap2/clock_common_data.c | 14 --
  3 files changed, 35 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
 index 6ad5b4d..d9c128e 100644
 --- a/arch/arm/mach-omap2/clock.c
 +++ b/arch/arm/mach-omap2/clock.c
 @@ -23,7 +23,6 @@
  #include linux/clk-provider.h
  #include linux/io.h
  #include linux/bitops.h
 -#include linux/clk-private.h
  #include asm/cpu.h
  
  #include trace/events/power.h
 @@ -630,21 +629,6 @@ const struct clk_hw_omap_ops clkhwops_wait = {
  };
  
  /**
 - * omap_clocks_register - register an array of omap_clk
 - * @ocs: pointer to an array of omap_clk to register
 - */
 -void __init omap_clocks_register(struct omap_clk oclks[], int cnt)
 -{
 - struct omap_clk *c;
 -
 - for (c = oclks; c  oclks + cnt; c++) {
 - clkdev_add(c-lk);
 - if (!__clk_init(NULL, c-lk.clk))
 - omap2_init_clk_hw_omap_clocks(c-lk.clk);
 - }
 -}
 -
 -/**
   * omap2_clk_switch_mpurate_at_boot - switch ARM MPU rate by boot-time 
 argument
   * @mpurate_ck_name: clk name of the clock to change rate
   *
 diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
 index c5b3a7f..6a10ce3 100644
 --- a/arch/arm/mach-omap2/clock.h
 +++ b/arch/arm/mach-omap2/clock.h
 @@ -245,7 +245,6 @@ struct ti_clk_features {
  extern struct ti_clk_features ti_clk_features;
  
  extern const struct clkops clkops_omap2_dflt_wait;
 -extern const struct clkops clkops_dummy;
  extern const struct clkops clkops_omap2_dflt;
  
  extern struct clk_functions omap2_clk_functions;
 @@ -254,8 +253,6 @@ extern const struct clksel_rate gpt_32k_rates[];
  extern const struct clksel_rate gpt_sys_rates[];
  extern const struct clksel_rate gfx_l3_rates[];
  extern const struct clksel_rate dsp_ick_rates[];
 -extern struct clk_core dummy_ck_core;
 -extern struct clk dummy_ck;
  
  extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
  extern const struct clk_hw_omap_ops clkhwops_wait;
 @@ -280,7 +277,5 @@ extern void __iomem *clk_memmaps[];
  extern int omap2_clkops_enable_clkdm(struct clk_hw *hw);
  extern void omap2_clkops_disable_clkdm(struct clk_hw *hw);
  
 -extern void omap_clocks_register(struct omap_clk *oclks, int cnt);
 -
  void __init ti_clk_init_features(void);
  #endif
 diff --git a/arch/arm/mach-omap2/clock_common_data.c 
 b/arch/arm/mach-omap2/clock_common_data.c
 index febd0a2..61b60df 100644
 --- a/arch/arm/mach-omap2/clock_common_data.c
 +++ b/arch/arm/mach-omap2/clock_common_data.c
 @@ -16,7 +16,6 @@
   * OMAP3xxx clock definition files.
   */
  
 -#include linux/clk-private.h
  #include clock.h
  
  /* clksel_rate data common to 24xx/343x */
 @@ -114,16 +113,3 @@ const struct clksel_rate div31_1to31_rates[] = {
   { .div = 31, .val = 31, .flags = RATE_IN_4430 | RATE_IN_AM33XX },
   { .div = 0 },
  };
 -
 -/* Clocks shared between various OMAP SoCs */
 -
 -static struct clk_ops dummy_ck_ops = {};
 -
 -struct clk_core dummy_ck_core = {
 - .name = dummy_clk,
 - .ops = dummy_ck_ops,
 - .flags = CLK_IS_BASIC,
 -};
 -struct clk dummy_ck = {
 - .core = dummy_ck_core,
 -};
 -- 
 1.9.1
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH-v2 0/4] mmc: switch to 1-bit mode which stopping clocks.

2015-01-30 Thread NeilBrown
This is a new version which moves most of the code into
mmc/core so it is available to all drivers.

I was wrong about not being able to sleep in pm_runtime callbacks.
There are spinlocks, but not the ones I thought they were...

Anyway, I tried switching to 1-bit mode from within the
runtime_suspend callback and hit a different problem.
The sequence to switch to 1-bit involves calling set_ios
which, for omap_hsmmc at least, calls pm_runtime_get_sync().

Calling pm_runtime_get_sync from the runtime_suspend callback
deadlocks.

It would be possible to remove the pm_runtime_get_sync call
from set_ios() functions, and instead call host-enable(),
host-disable() around those mmc_set_ios() calls which don't
have the host claimed.  However that seems a bit fragile to me.

So for now I'm persisting with doing the width change from
a work-queue.  This set of patches does that.

If you think calling host-enable/disable around mmc_set_ios() calls
does make sense, I can post my other patch for review.

Thanks,
NeilBrown


---

NeilBrown (4):
  mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus.
  mmc: core: allow non-blocking form of mmc_claim_host
  mmc: sdio: support switching to 1-bit before turning off clocks
  mmc: omap_hsmmc: switch to 1-bit before stopping clocks.


 drivers/mmc/core/core.c   |   21 +---
 drivers/mmc/core/sdio.c   |   74 +
 drivers/mmc/host/omap_hsmmc.c |   13 ++-
 include/linux/mmc/core.h  |2 +
 include/linux/mmc/host.h  |2 +
 5 files changed, 83 insertions(+), 29 deletions(-)

--
Signature

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/11] ARM: OMAP3: legacy clock data move under clk driver

2015-01-30 Thread Mike Turquette
Quoting Tero Kristo (2015-01-30 07:20:36)
 On 01/30/2015 02:42 AM, Mike Turquette wrote:
  Quoting Tero Kristo (2015-01-29 12:19:29)
  On 01/08/2015 01:00 AM, Tony Lindgren wrote:
  * Tero Kristo t-kri...@ti.com [141216 08:22]:
  Hi,
 
  These patches move the legacy clock data for omap3 under drivers/clk/ti.
  After these patches are applied, it should be possible to get rid of
  clk-private.h (long pending project for Mike.)
 
  Testing done (on top of 3.18-rc1):
 
  omap3-beagle: boot / suspend-resume (ret/off) / cpuidle (ret/off)
  omap3-beagle-xm: boot upto fs mount (see note below)
  sdp3430: boot
  n900: boot
 
  Note: beagle-xm failed with FS mount on the board I have access to, but
  this happens with clean 3.18-rc1 and linux-next also at the 
  moment.
  The board has probably corrupted filesystem image but I am unable
  to fix this atm (remote board.)
 
  Test branch:
  tree: https://github.com/t-kristo/linux-pm.git
  branch: 3.18-rc1-omap3-clk-rework
 
  Great, hopefully this will finally allow Mike to make the
  generic struct clk private to drivers/clk :)
 
  Seems to boot just fine based on a quick legacy booting test
  on n900.
 
  Mike, assuming no other issues, can you please apply these into a
  immutable branch against v3.19-rc1 that Paul and I can also merge
  in as needed?
 
  Please also feel free to add:
 
  Acked-by: Tony Lindgren t...@atomide.com
 
 
  I just rebased these patches on top of 3.19-rc1, and noticed a problem
  with dpll5 on beagle-xm (basically a divide-by-zero error + locking
  issue during boot.) The extra diff at the end of this email fixes the
  problems, I will also send the updated two patches as v2. Updated branch
  available in my tree under name 3.19-rc1-omap3-clk-rework.
 
  I've applied these 11 patches on top of v3.19-rc1, including the two V2
  patches for #6 and #8 to the clk-omap-legacy branch here:
 
  git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-omap-legacy
 
  Let me know if I screwed anything up. I've merged this immutable branch
  into clk-next.
 
  In addition I've made some changes to remove clk-private.h permanently.
  I'll post those later today. Again, please let me know if I screwed
  anything up.
 
 I can't see the clk-omap-legacy merged to clk-next so far, maybe you did 
 not push it yet? The branch itself is identical copy of mine, so can't 
 see any issues there so far.

That is correct. There are a lot of unrelated changes in clk-next right
now so I didn't push this OMAP stuff last night. Turns out to be a good
thing since linux-next had some breakage today. Once that is resolved
I'll push this out, but clk-omap-legacy IS merged locally in my tree,
just not on the public git that linux-next pulls.

Regards,
Mike

 
 -Tero
 
 
  Regards,
  Mike
 
 
  - Tero
 
  -
 
  diff --git a/drivers/clk/ti/clk-3xxx-legacy.c
  b/drivers/clk/ti/clk-3xxx-legacy.c
  index 81ad510..e0732a4 100644
  --- a/drivers/clk/ti/clk-3xxx-legacy.c
  +++ b/drivers/clk/ti/clk-3xxx-legacy.c
  @@ -136,6 +136,7 @@ static struct ti_clk_dpll dpll3_ck_data = {
   .idlest_mask = 0x1,
   .auto_recal_bit = 0x3,
   .max_divider = 0x80,
  +   .min_divider = 0x1,
   .recal_en_bit = 0x5,
   .max_multiplier = 0x7ff,
   .enable_mask = 0x7,
  @@ -307,6 +308,7 @@ static struct ti_clk_dpll dpll4_ck_data = {
   .idlest_mask = 0x2,
   .auto_recal_bit = 0x13,
   .max_divider = 0x80,
  +   .min_divider = 0x1,
   .recal_en_bit = 0x6,
   .max_multiplier = 0x7ff,
   .enable_mask = 0x7,
  @@ -507,6 +509,7 @@ static struct ti_clk_dpll dpll5_ck_data = {
   .idlest_mask = 0x1,
   .auto_recal_bit = 0x3,
   .max_divider = 0x80,
  +   .min_divider = 0x1,
   .recal_en_bit = 0x19,
   .max_multiplier = 0x7ff,
   .enable_mask = 0x7,
  @@ -1271,6 +1274,7 @@ static struct ti_clk_dpll dpll1_ck_data = {
   .idlest_mask = 0x1,
   .auto_recal_bit = 0x3,
   .max_divider = 0x80,
  +   .min_divider = 0x1,
   .recal_en_bit = 0x7,
   .max_multiplier = 0x7ff,
   .enable_mask = 0x7,
  @@ -2154,6 +2158,7 @@ static struct ti_clk_dpll dpll2_ck_data = {
   .idlest_mask = 0x1,
   .auto_recal_bit = 0x3,
   .max_divider = 0x80,
  +   .min_divider = 0x1,
   .recal_en_bit = 0x8,
   .max_multiplier = 0x7ff,
   .enable_mask = 0x7,
  @@ -2513,6 +2518,7 @@ static struct ti_clk_dpll dpll4_ck_omap36xx_data = {
   .idlest_mask = 0x2,
   .auto_recal_bit = 0x13,
   .max_divider = 0x80,
  +   .min_divider = 0x1,
   .recal_en_bit = 0x6,
   .max_multiplier = 0xfff,
   .enable_mask = 0x7,
  diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
  index 8d9c603..404158d 100644
  --- a/drivers/clk/ti/clock.h
  +++ b/drivers/clk/ti/clock.h
  @@ -148,6 

[PATCH] ARM: dst: OMAP3-N900: Add microphone bias voltages

2015-01-30 Thread Jarkko Nikula
From: Pavel Machek pa...@ucw.cz

N900 audio recording needs that codec provides bias voltage for integrated
digital microphone and headset microphone depending which one is used.
Digital microphone uses 2 V bias and it comes from the codec A part. Codec
B part drives the headset microphone bias and that is set to 2.5 V.

Signed-off-by: Pavel Machek pa...@ucw.cz
[Jarkko: Headset mic bias changed to 2 (2.5 V) as it was before commit
e2e8bfdf6157 (ASoC: tlv320aic3x: Convert mic bias to a supply widget)]
Signed-off-by: Jarkko Nikula jarkko.nik...@bitmer.com
---
Pavel: I hope you don't mind I took your diff from
http://marc.info/?l=linux-kernelm=142249383224678w=2
and added your Signed-off-by?
---
 arch/arm/boot/dts/omap3-n900.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index b550c41b46f1..f7858f5974e3 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -478,6 +478,8 @@
DRVDD-supply = vmmc2;
IOVDD-supply = vio;
DVDD-supply = vio;
+
+   ai3x-micbias-vg = 1;
};
 
tlv320aic3x_aux: tlv320aic3x@19 {
@@ -489,6 +491,8 @@
DRVDD-supply = vmmc2;
IOVDD-supply = vio;
DVDD-supply = vio;
+
+   ai3x-micbias-vg = 2;
};
 
tsl2563: tsl2563@29 {
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Clock Regression in next-20150130 caused by cb75a8fcd14e

2015-01-30 Thread Tony Lindgren
Hi all,

Looks like commit cb75a8fcd14e (clk: Add rate constraints to clocks)
causes a regression on at least omaps where the serial console either
does not show anything, or just prints garbage.

Reverting cb75a8fcd14e makes things work again on next-20150130.

Any ideas?

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v13 4/6] clk: Add rate constraints to clocks

2015-01-30 Thread Stephen Boyd
On 01/29, Stephen Boyd wrote:
 On 01/29/15 05:31, Geert Uytterhoeven wrote:
  Hi Tomeu, Mike,
 
  On Fri, Jan 23, 2015 at 12:03 PM, Tomeu Vizoso
  tomeu.viz...@collabora.com wrote:
  --- a/drivers/clk/clk.c
  +++ b/drivers/clk/clk.c
  @@ -2391,25 +2543,24 @@ int __clk_get(struct clk *clk)
  return 1;
   }
 
  -static void clk_core_put(struct clk_core *core)
  +void __clk_put(struct clk *clk)
   {
  struct module *owner;
 
  -   owner = core-owner;
  +   if (!clk || WARN_ON_ONCE(IS_ERR(clk)))
  +   return;
 
  clk_prepare_lock();
  -   kref_put(core-ref, __clk_release);
  +
  +   hlist_del(clk-child_node);
  +   clk_core_set_rate_nolock(clk-core, clk-core-req_rate);
  At this point, clk-core-req_rate is still zero, causing
  cpg_div6_clock_round_rate() to be called with a zero rate parameter,
  e.g. on r8a7791:
 
 Hmm.. I wonder if we should assign core-req_rate to be the same as
 core-rate during __clk_init()? That would make this call to
 clk_core_set_rate_nolock() a nop in this case.
 

Here's a patch to do this

---8
From: Stephen Boyd sb...@codeaurora.org
Subject: [PATCH] clk: Assign a requested rate by default

We need to assign a requested rate here so that we avoid
requesting a rate of 0 on clocks when we remove clock consumers.

Signed-off-by: Stephen Boyd sb...@codeaurora.org
---
 drivers/clk/clk.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index a29daf9edea4..8416ed1c40be 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2142,6 +2142,7 @@ int __clk_init(struct device *dev, struct clk *clk_user)
struct clk_core *orphan;
struct hlist_node *tmp2;
struct clk_core *clk;
+   unsigned long rate;
 
if (!clk_user)
return -EINVAL;
@@ -2266,12 +2267,13 @@ int __clk_init(struct device *dev, struct clk *clk_user)
 * then rate is set to zero.
 */
if (clk-ops-recalc_rate)
-   clk-rate = clk-ops-recalc_rate(clk-hw,
+   rate = clk-ops-recalc_rate(clk-hw,
clk_core_get_rate_nolock(clk-parent));
else if (clk-parent)
-   clk-rate = clk-parent-rate;
+   rate = clk-parent-rate;
else
-   clk-rate = 0;
+   rate = 0;
+   clk-rate = clk-req_rate = rate;
 
/*
 * walk the list of orphan clocks and reparent any that are children of
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 1/4] Documentation: dt: add common bindings for hwspinlock

2015-01-30 Thread Bjorn Andersson
On Fri, Jan 16, 2015 at 4:46 PM, Ohad Ben-Cohen o...@wizery.com wrote:
 Mark,

 On Fri, Jan 16, 2015 at 12:17 PM, Mark Rutland mark.rutl...@arm.com wrote:
 The hwlock is a basic hardware primitive that allow synchronization
 between different processors in the system, which may be running Linux
 as well as other operating systems, and may have no other means of
 communication.

 The hwlock id numbers are predefined, global and static across the
 entire system: Linux may boot well after other operating systems are
 already running and using these hwlocks to communicate, and therefore,
 in order to use these hardware devices, it must not enumerate them
 differently than the rest of the system.

 That's not true.

 In order to communicate it must agree with the other users as to the
 meaning of each instance, and the protocol for use. That doesn't
 necessarily mean that Linux needs to know the numerical ID from a
 datasheet, and regardless that ID is separate from the logical ID Linux
 uses internally.

 Let me describe hwspinlocks a bit more so we all get to know it better
 and can then agree on a proper solution.

 - What makes handling of hwspinlock ID numbers convenient is the fact
 that it's not based on random datasheet numbers. In fact, hwspinlocks
 is just special memory: usually datasheets just define the base
 address and the size of the hwspinlock area. So any numerical ID we
 use to call the locks themselves are already logical and sane, similar
 to the way we handle memory (i.e. if we have 32 locks we'll always use
 0..31). So hwlocks ids are very much like memory addressing, and not
 irq numbers.


But that's exactly how irqs or gpios work as well. If you have 32
gpios in a system they used to be numbered 0-31 and people would
reference them directly by that number. Every one of the systems that
was designed in this way is moving away from it.

 - Sometimes Linux will have to dynamically allocate a hwlock, and send
 the ID of the allocated lock to a remote processor (which may not be
 running Linux).

In a system where you have two hwlock blocks lckA and lckB, each
consisting of 8 locks and you have dspB that can only access lckB;
will you tell the firmware engineers to always subtract 8 from the
numbers you pass them?

Wouldn't it make much more sense to have local indexes here and pass
them e.g lckB:2?

 - Sometimes a remote processor, which may not be running Linux, will
 have to dynamically allocate a hwlock, and send the ID of the
 allocated lock to us (another processor running Linux)


I'm sorry but you cannot have a system on both sides that is allowed
to do dynamic allocation from a limited set of resources.

Further more this dynamic allocation leads to interesting race
conditions as what happens if you dynamically allocate a hwlock that
is statically allocated by another part of the system?
The only solution I can think of is to have a static allocation of ids
that the dynamic allocator might use, and then we're just carrying
extra code when the system is already statically configured...

 We cannot tell in advance what kind of IPC is going to be used for
 sending and receiving this hwlock ID. Some are handled by Linux
 (kernel) and some by the user space. So we must be able to expose an
 ID the system will understand as well as receive one.


Designing this interface to take into consideration that someone might
send us something completely crazy isn't productive.


The only reason for having num-locks and base-id in device tree is
because of the current Linux implementation. base-id is not a property
of the hardware and num-locks is not needed for anything but book
keeping of base-id's in the hwlock framework.

This is why I preferred Sumans earlier suggestion of having the
binding consist of #hwlock-cells = X and the necessary accessor
functions for resolving a hwlock based on a dt reference.

Regards,
Bjorn
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] omap device tree changes for v3.20, part 3

2015-01-30 Thread Tony Lindgren
The following changes since commit 1f43c45df7afb706470f7d81d983dd7763a9452f:

  ARM: dts: dra72-evm: Add qspi device (2015-01-20 10:07:25 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
tags/omap-for-v3.20/dt-pt3-v2

for you to fetch changes up to 726806ad9ba10f8ba8d26ba8154d98a7c9b89a12:

  ARM: dts: am57xx-beagle-x15: Fix USB2 mode (2015-01-30 15:48:39 -0800)


Device tree related chages for omaps to fix dm816x syscon,
fix various devices for gta04, and add USB nodes for am57xx
and dra7.


H. Nikolaus Schaller (5):
  ARM: dts: omap3-gta04: Fix backup-battery charging in devicetree file.
  ARM: dts: omap3-gta04: Fix audio node malformatting
  ARM: dts: omap3-gta04: Enable mcbps2 necessary for audio
  ARM: dts: omap3-gta04: Enable twl audio vibra support
  ARM: dts: omap3-gta04: Enable power-off using twl4030

Marek Belisko (2):
  ARM: dts: omap3-gta04: Fix a GPIO line for bma180 node
  ARM: dts: omap3-gta04: Add ramp value for twl4030 audio

NeilBrown (5):
  ARM: dts: omap3-gta04: add comments about gpios
  ARM: dts: omap3-gta04: enable power-off for wifi card.
  ARM: dts: omap3-gta04: add gyroscope
  ARM: dts: omap3-gta04: only power DSS when necessary.
  ARM: dts: omap3-gta04: Disable keypad

Roger Quadros (4):
  ARM: dts: dra7-evm: Add extcon nodes for USB
  ARM: dts: dra72-evm: Add extcon nodes for USB
  ARM: dts: am57xx-beagle-x15: Add extcon nodes for USB
  ARM: dts: am57xx-beagle-x15: Fix USB2 mode

Tony Lindgren (1):
  ARM: dts: Fix dm816x pinctrl and syscon so they are children of SCM

 arch/arm/boot/dts/am57xx-beagle-x15.dts | 37 
 arch/arm/boot/dts/dm816x.dtsi   | 35 +--
 arch/arm/boot/dts/dra7-evm.dts  | 31 
 arch/arm/boot/dts/dra72-evm.dts | 31 
 arch/arm/boot/dts/omap3-gta04.dtsi  | 50 +++--
 5 files changed, 154 insertions(+), 30 deletions(-)
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Changes to cpsw and davinci_emac for getting MAC address

2015-01-30 Thread David Miller
From: Tony Lindgren t...@atomide.com
Date: Wed, 28 Jan 2015 11:33:03 -0800

 Here are a few patches to add common code for cpsw and davinci_emac for
 getting the MAC address. Looks like we can also now add code to get the
 MAC address on 3517 but in a slightly different way.

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Clock Regression in next-20150130 caused by cb75a8fcd14e

2015-01-30 Thread Guenter Roeck
On Fri, Jan 30, 2015 at 05:04:44PM -0800, Tony Lindgren wrote:
 Hi all,
 
 Looks like commit cb75a8fcd14e (clk: Add rate constraints to clocks)
 causes a regression on at least omaps where the serial console either
 does not show anything, or just prints garbage.
 
 Reverting cb75a8fcd14e makes things work again on next-20150130.
 
 Any ideas?
 
The patch seems to have some problems.
Also see http://www.spinics.net/lists/kernel/msg1916843.html.

Guenter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 1/4] Documentation: dt: add common bindings for hwspinlock

2015-01-30 Thread Ohad Ben-Cohen
On Sat, Jan 31, 2015 at 1:29 AM, Bjorn Andersson bj...@kryo.se wrote:
 In a system where you have two hwlock blocks lckA and lckB, each
 consisting of 8 locks and you have dspB that can only access lckB

This is a good example - thanks. To be able to cope with such cases we
will have to pass a hwlock block reference and its relative lock id.

The DT binding should definitely be prepared for such cases (just kill
the base-id field?), but let's see what it means about the Linux
implementation.

Since the existence of several hwblocks is still fictional (Bjorn,
please confirm too?), we may prefer to introduce changes to support it
only when it shows up; it all depends on the amount of changes needed.
Suman, care to take a look please?

 - Sometimes a remote processor, which may not be running Linux, will
 have to dynamically allocate a hwlock, and send the ID of the
 allocated lock to us (another processor running Linux)

 I'm sorry but you cannot have a system on both sides that is allowed
 to do dynamic allocation from a limited set of resources.

Of course not. On such systems, Linux is not the one responsible for
allocating the hwlocks, at least not during part of the time or from
part of the hwlocks. There were a few different use cases, with
different semantics, that required communicating to Linux an hwlock
id, but since none of them have reached mainline, we should only
remember they may show up one day, but not put too much effort to
support them right now.

Thanks,
Ohad.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] irqchip: gic: Don't complain in gic_get_cpumask() if UP system

2015-01-30 Thread Felipe Balbi
+linux-omap

On Fri, Jan 30, 2015 at 04:43:30PM -0800, Stephen Boyd wrote:
 In a uniprocessor implementation the interrupt processor targets
 registers are read-as-zero/write-ignored (RAZ/WI). Unfortunately
 gic_get_cpumask() will print a critical message saying
 
  GIC CPU mask not found - kernel will fail to boot.
 
 if these registers all read as zero, but there won't actually be
 a problem on uniprocessor systems and the kernel will boot just
 fine. Skip this check if we're running a UP kernel or if we
 detect that the hardware only supports a single processor.
 

Nice, I'll test this on AM437x on Monday but certainly looks promising:

Acked-by: Felipe Balbi ba...@ti.com


 Acked-by: Nicolas Pitre n...@linaro.org
 Cc: Russell King rmk+ker...@arm.linux.org.uk
 Cc: Stefan Agner ste...@agner.ch
 Signed-off-by: Stephen Boyd sb...@codeaurora.org
 ---
  drivers/irqchip/irq-gic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
 index d617ee5a3d8a..1b70e0de0f6e 100644
 --- a/drivers/irqchip/irq-gic.c
 +++ b/drivers/irqchip/irq-gic.c
 @@ -346,7 +346,7 @@ static u8 gic_get_cpumask(struct gic_chip_data *gic)
   break;
   }
  
 - if (!mask)
 + if (!mask  num_possible_cpus()  1)
   pr_crit(GIC CPU mask not found - kernel will fail to boot.\n);
  
   return mask;
 -- 
 The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
 a Linux Foundation Collaborative Project
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v2 2/7] usb: extcon: Fix USB-Host cable name

2015-01-30 Thread Roger Quadros
Hi,

On 30/01/15 13:04, Roger Quadros wrote:
 Felipe  Chanwoo,
 
 On 26/01/15 14:15, Roger Quadros wrote:
 The recommended name for USB-Host cable state is USB-Host and not
 USB-HOST as per drivers/extcon/extcon-class.c extcon_cable_name.

 Change all instances of USB-HOST to USB-Host.

 Signed-off-by: Roger Quadros rog...@ti.com
 Reviewed-by: Felipe Balbi ba...@ti.com
 Acked-by: Felipe Balbi ba...@ti.com
 
 This patch has no dependency to the rest so can be picked up as soon as 
 possible.
 
 Do you think it is better to go via the USB tree?
 If yes then Chanwoo, can you please Ack this one? Thanks.
 
 This would mean that only the first patch needs to go through extcon tree as 
 Tony
 will pick the rest.

Hold on. Let's first decide what we really want to go ahead with
USB-Host or USB-HOST.

cheers,
-roger
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 1/7] extcon: usb-gpio: Introduce gpio usb extcon driver

2015-01-30 Thread Roger Quadros
+Thomas (for irq/dummychip.c question)

Hi,

On 30/01/15 13:09, Roger Quadros wrote:
 Chanwoo,
 
 On 30/01/15 02:06, Chanwoo Choi wrote:
 Hi Roger,

 On 01/29/2015 08:26 PM, Roger Quadros wrote:
 Chanwoo,

 On 29/01/15 03:49, Chanwoo Choi wrote:
 Hi Roger,

 We need to discuss one point about 'id_irqwake'.
 I don't recommend to use 'id_irqwake' field.

 And I catch build warning by using select keywork in Kconfig.
 It is my wrong guide of select keyword. So, I'll change it 
 as 'depends on' keyword.

 Looks good to me except for 'id_irqwake'. 
 I'll apply this patch on 3.21 queue after completing this discussion.

 On 01/28/2015 09:15 PM, Roger Quadros wrote:
 This driver observes the USB ID pin connected over a GPIO and
 updates the USB cable extcon states accordingly.

 The existing GPIO extcon driver is not suitable for this purpose
 as it needs to be taught to understand USB cable states and it
 can't handle more than one cable per instance.

 For the USB case we need to handle 2 cable states.
 1) USB (attach/detach)
 2) USB-Host (attach/detach)

 This driver can be easily updated in the future to handle VBUS
 events in case it happens to be available on GPIO for any platform.

 Signed-off-by: Roger Quadros rog...@ti.com
 ---
 v3:
 - removed IRQF_NO_SUSPEND flag. Added IRQF_TRIGGER_RISING and
   IRQF_TRIGGER_FALLING
 - Added disable_irq() to suspend() and enable_irq() to resume()

  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |  18 ++
  drivers/extcon/Kconfig |   7 +
  drivers/extcon/Makefile|   1 +
  drivers/extcon/extcon-usb-gpio.c   | 233 
 +
  4 files changed, 259 insertions(+)
  create mode 100644 
 Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
  create mode 100644 drivers/extcon/extcon-usb-gpio.c

 diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt 
 b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 new file mode 100644
 index 000..85fe6b0
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 @@ -0,0 +1,18 @@
 +USB GPIO Extcon device
 +
 +This is a virtual device used to generate USB cable states from the USB 
 ID pin
 +connected to a GPIO pin.
 +
 +Required properties:
 +- compatible: Should be linux,extcon-usb-gpio
 +- id-gpio: gpio for USB ID pin. See gpio binding.
 +
 +Example:
 + extcon_usb1 {
 + compatible = linux,extcon-usb-gpio;
 + id-gpio = gpio6 1 GPIO_ACTIVE_HIGH;
 + }
 +
 + omap_dwc3_1 {
 + extcon = extcon_usb1;
 + };
 diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
 index 6a1f7de..fd11536 100644
 --- a/drivers/extcon/Kconfig
 +++ b/drivers/extcon/Kconfig
 @@ -93,4 +93,11 @@ config EXTCON_SM5502
 Silicon Mitus SM5502. The SM5502 is a USB port accessory
 detector and switch.
  
 +config EXTCON_USB_GPIO
 + tristate USB GPIO extcon support
 + select GPIOLIB

 I catch the build warning if using 'select' instead of 'depends on' as 
 following:
 It is my wrong guide to you. So, I'll modify it by using depends on as 
 your original patch.

 OK. Thanks.


 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage  -j 8
 scripts/kconfig/conf --silentoldconfig Kconfig
 drivers/gpio/Kconfig:34:error: recursive dependency detected!
 drivers/gpio/Kconfig:34:   symbol GPIOLIB is selected by EXTCON_USB_GPIO
 drivers/extcon/Kconfig:96: symbol EXTCON_USB_GPIO depends on EXTCON
 drivers/extcon/Kconfig:1:  symbol EXTCON is selected by CHARGER_MANAGER
 drivers/power/Kconfig:316: symbol CHARGER_MANAGER depends on POWER_SUPPLY
 drivers/power/Kconfig:1:   symbol POWER_SUPPLY is selected by HID_SONY
 drivers/hid/Kconfig:670:   symbol HID_SONY depends on NEW_LEDS
 drivers/leds/Kconfig:8:symbol NEW_LEDS is selected by BCMA_DRIVER_GPIO
 drivers/bcma/Kconfig:75:   symbol BCMA_DRIVER_GPIO depends on GPIOLIB

 + help
 +   Say Y here to enable GPIO based USB cable detection extcon support.
 +   Used typically if GPIO is used for USB ID pin detection.
 +
  endif # MULTISTATE_SWITCH
 diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
 index 0370b42..6a08a98 100644
 --- a/drivers/extcon/Makefile
 +++ b/drivers/extcon/Makefile
 @@ -12,3 +12,4 @@ obj-$(CONFIG_EXTCON_MAX8997)+= extcon-max8997.o
  obj-$(CONFIG_EXTCON_PALMAS)  += extcon-palmas.o
  obj-$(CONFIG_EXTCON_RT8973A) += extcon-rt8973a.o
  obj-$(CONFIG_EXTCON_SM5502)  += extcon-sm5502.o
 +obj-$(CONFIG_EXTCON_USB_GPIO)+= extcon-usb-gpio.o
 diff --git a/drivers/extcon/extcon-usb-gpio.c 
 b/drivers/extcon/extcon-usb-gpio.c
 new file mode 100644
 index 000..99a58b2
 --- /dev/null
 +++ b/drivers/extcon/extcon-usb-gpio.c
 @@ -0,0 +1,233 @@
 +/**
 + * drivers/extcon/extcon-usb-gpio.c - USB GPIO extcon driver
 + *
 + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
 + * Author: Roger Quadros rog...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * 

Re: [PATCH v3 1/7] extcon: usb-gpio: Introduce gpio usb extcon driver

2015-01-30 Thread Roger Quadros
On 30/01/15 02:11, Chanwoo Choi wrote:
 Hi Roger,
 
 On 01/28/2015 09:15 PM, Roger Quadros wrote:
 This driver observes the USB ID pin connected over a GPIO and
 updates the USB cable extcon states accordingly.

 The existing GPIO extcon driver is not suitable for this purpose
 as it needs to be taught to understand USB cable states and it
 can't handle more than one cable per instance.

 For the USB case we need to handle 2 cable states.
 1) USB (attach/detach)
 2) USB-Host (attach/detach)

 This driver can be easily updated in the future to handle VBUS
 events in case it happens to be available on GPIO for any platform.

 Signed-off-by: Roger Quadros rog...@ti.com
 ---
 v3:
 - removed IRQF_NO_SUSPEND flag. Added IRQF_TRIGGER_RISING and
   IRQF_TRIGGER_FALLING
 - Added disable_irq() to suspend() and enable_irq() to resume()

  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |  18 ++
  drivers/extcon/Kconfig |   7 +
  drivers/extcon/Makefile|   1 +
  drivers/extcon/extcon-usb-gpio.c   | 233 
 +
  4 files changed, 259 insertions(+)
  create mode 100644 
 Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
  create mode 100644 drivers/extcon/extcon-usb-gpio.c

 diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt 
 b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 new file mode 100644
 index 000..85fe6b0
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 @@ -0,0 +1,18 @@
 +USB GPIO Extcon device
 +
 +This is a virtual device used to generate USB cable states from the USB ID 
 pin
 +connected to a GPIO pin.
 +
 +Required properties:
 +- compatible: Should be linux,extcon-usb-gpio
 +- id-gpio: gpio for USB ID pin. See gpio binding.
 +
 +Example:
 +extcon_usb1 {
 +compatible = linux,extcon-usb-gpio;
 +id-gpio = gpio6 1 GPIO_ACTIVE_HIGH;
 +}
 +
 +omap_dwc3_1 {
 +extcon = extcon_usb1;
 +};
 diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
 index 6a1f7de..fd11536 100644
 --- a/drivers/extcon/Kconfig
 +++ b/drivers/extcon/Kconfig
 @@ -93,4 +93,11 @@ config EXTCON_SM5502
Silicon Mitus SM5502. The SM5502 is a USB port accessory
detector and switch.
  
 +config EXTCON_USB_GPIO
 +tristate USB GPIO extcon support
 +select GPIOLIB
 +help
 +  Say Y here to enable GPIO based USB cable detection extcon support.
 +  Used typically if GPIO is used for USB ID pin detection.
 +
  endif # MULTISTATE_SWITCH
 diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
 index 0370b42..6a08a98 100644
 --- a/drivers/extcon/Makefile
 +++ b/drivers/extcon/Makefile
 @@ -12,3 +12,4 @@ obj-$(CONFIG_EXTCON_MAX8997)   += extcon-max8997.o
  obj-$(CONFIG_EXTCON_PALMAS) += extcon-palmas.o
  obj-$(CONFIG_EXTCON_RT8973A)+= extcon-rt8973a.o
  obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o
 +obj-$(CONFIG_EXTCON_USB_GPIO)   += extcon-usb-gpio.o
 diff --git a/drivers/extcon/extcon-usb-gpio.c 
 b/drivers/extcon/extcon-usb-gpio.c
 new file mode 100644
 index 000..99a58b2
 --- /dev/null
 +++ b/drivers/extcon/extcon-usb-gpio.c
 @@ -0,0 +1,233 @@
 +/**
 + * drivers/extcon/extcon-usb-gpio.c - USB GPIO extcon driver
 + *
 + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
 + * Author: Roger Quadros rog...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + */
 +
 +#include linux/extcon.h
 +#include linux/init.h
 +#include linux/interrupt.h
 +#include linux/irq.h
 +#include linux/kernel.h
 +#include linux/module.h
 +#include linux/of_gpio.h
 +#include linux/platform_device.h
 +#include linux/slab.h
 +#include linux/workqueue.h
 +
 +#define USB_GPIO_DEBOUNCE_MS20  /* ms */
 +
 +struct usb_extcon_info {
 +struct device *dev;
 +struct extcon_dev *edev;
 +
 +struct gpio_desc *id_gpiod;
 +int id_irq;
 +bool id_irqwake;/* ID wakeup enabled flag */
 +
 +unsigned long debounce_jiffies;
 +struct delayed_work wq_detcable;
 +};
 +
 +/* List of detectable cables */
 +enum {
 +EXTCON_CABLE_USB = 0,
 +EXTCON_CABLE_USB_HOST,
 +
 +EXTCON_CABLE_END,
 +};
 +
 +static const char *usb_extcon_cable[] = {
 +[EXTCON_CABLE_USB] = USB,
 +[EXTCON_CABLE_USB_HOST] = USB-Host,
 
 I'll use the defined name for extcon cable name as soon because 
 it has potential isseu about the conflict of extcon cable name between 
 subsystems.
 So, I recommend to use a captical letter as USB-HOST 

[PATCH] omapfb: Return error code when applying overlay settings fails

2015-01-30 Thread Peter Meerwald
the check of the return code is missing, user space does not get notified
about the error condition:

omapdss OVERLAY error: overlay 2 horizontally not inside the display area (403 
+ 800 = 800)
omapdss APPLY error: failed to apply settings: illegal configuration.

Signed-off-by: Peter Meerwald pme...@pmeerw.net
---
 drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c 
b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
index 146b6f5..9ddfdd6 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c
@@ -137,8 +137,11 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct 
omapfb_plane_info *pi)
goto undo;
}
 
-   if (ovl-manager)
-   ovl-manager-apply(ovl-manager);
+   if (ovl-manager) {
+   r = ovl-manager-apply(ovl-manager);
+   if (r)
+   goto undo;
+   }
 
if (pi-enabled) {
r = ovl-enable(ovl);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 3.19 on Nokia n900: audio quality awful

2015-01-30 Thread Pavel Machek
Hi!

I looked around the diff between 3.18 and 3.19, reverted these, and
audio quality is back to reasonable level.

commit 68f438378cde79e29f71c7e043b10d76001d8892
Author: Lars-Peter Clausen l...@metafoo.de
Date:   Wed Nov 26 20:57:57 2014 +0100

ASoC: tlv320aic3x: Cleanup manual bias level transitions

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to
do it manually
anymore.

Signed-off-by: Lars-Peter Clausen l...@metafoo.de
Signed-off-by: Mark Brown broo...@kernel.org

commit 68d6626925c3529790a2055d41578415fa98495e
Author: Misael Lopez Cruz misael.lo...@ti.com
Date:   Tue Nov 11 10:59:01 2014 +0200

ASoC: tlv320aic3x: Add output driver pop reduction controls

Output driver has two parameters that can be configured to reduce
pop noise: power-on delay and ramp-up step time. Two new
kcontrols
have been added to set these parameters.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
Signed-off-by: Mark Brown broo...@kernel.org


commit 368494093354ac613a80c2e1d77602aa12473cf0
Author: Peter Ujfalusi peter.ujfal...@ti.com
Date:   Mon Nov 10 12:27:33 2014 +0200

ASoC: tlv320aic3x: Add TDM support

TDM support is achieved using DSP transfer mode and setting a
programmable offset which specifies where data begins with
respect to the frame sync.

It requires 256-clock mode if CODEC is master (not currently
supported in the driver). No additional dependency if CODEC
is slave.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
Signed-off-by: Mark Brown broo...@kernel.org


 diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
 index 04896d6252a2..7f299357c2d2 100644
 --- a/sound/soc/omap/rx51.c
 +++ b/sound/soc/omap/rx51.c
 @@ -250,14 +250,14 @@ static const struct snd_soc_dapm_route audio_map[] = {
   {FM Transmitter, NULL, LLOUT},
   {FM Transmitter, NULL, RLOUT},
 
 - {DMic Rate 64, NULL, Mic Bias},
 - {Mic Bias, NULL, DMic},
 + {DMic Rate 64, NULL, DMic},
 + {DMic, NULL, Mic Bias},
 
   {b LINE2R, NULL, MONO_LOUT},
   {Earphone, NULL, b HPLOUT},
 
 - {LINE1L, NULL, b Mic Bias},
 - {b Mic Bias, NULL, HS Mic}
 + {LINE1L, NULL, HS Mic},
 + {HS Mic, NULL, b Mic Bias},
  };
 
  static const char * const spk_function[] = {Off, On};
 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 3.19 on Nokia n900: audio quality awful

2015-01-30 Thread Pavel Machek
Hi!

 I looked around the diff between 3.18 and 3.19, reverted these, and
 audio quality is back to reasonable level.

Actually, reverting 368494093354ac613a80c2e1d77602aa12473cf0 seems
enough.

Any quick patches to test? Or should we revert so that 3.19-final
works ok?

Thanks,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 3.19 on Nokia n900: audio quality awful

2015-01-30 Thread Pali Rohár
On Thursday 29 January 2015 21:42:18 Pavel Machek wrote:
 Hi!
 
   I did this:
   
   I'm not sure which one is main microphone and which is
   headset, but I guess 2V should be close enough to 2.5V
   to produce something different from zeros..?
   
   Main or integrated is digital microphone which does AD
   conversion itself and headset is analogue. If DMIC is
   without bias codec will sample plain zeros from DMIC
   input but analogue input should always produce some
   random LSB bits from codec's AD converter.
   
   If codec produces zeros also from analogue input then I
   suppose codec ADC is not powered up or similar. One way
   to hunt regression if bisecting is not possible due
   reason or another is to dump and diff codec registers
   from /sys/kernel/debug/regmap/ using both working commit
  
  and head.
 
 I tried 2.6.28... where recording was, but it does not support
 regmap. Then I tried 3.14, but could not get recording to work
 there.
 
tlv320aic3x_aux: tlv320aic3x@19 {
   
   @@ -502,6 +504,8 @@
   
DRVDD-supply = vmmc2;
IOVDD-supply = vio;
DVDD-supply = vio;
   
   +
   +ai3x-micbias-vg = 1;
   
};
   
   This should be 2, i.e. 2.5 V according to
   Documentation/devicetree/bindings/sound/tlv320aic3x.txt. I
   think 2 V is too low for some headset mics and that was
   the reason for 2.5 V.
 
 Ok, tried that, but no change.
 
  Can you also try this patch to correct the DAPM route for the 
rx51:
 Yes, with the patch below (and dts updates I did) recording
 works.
 
 Another interesting note is that audio quality is not that
 horrible when playing 8 kHz, mono signal... it is mostly what
 I'd expect. Playing 44.1kHz, stereo mp3 .. is not good.
 
 Tested-by: Pavel Machek pa...@ucw.cz
 
 Thanks,
   Pavel
 
  diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
  index 04896d6252a2..7f299357c2d2 100644
  --- a/sound/soc/omap/rx51.c
  +++ b/sound/soc/omap/rx51.c
  @@ -250,14 +250,14 @@ static const struct snd_soc_dapm_route
  audio_map[] = {
  
  {FM Transmitter, NULL, LLOUT},
  {FM Transmitter, NULL, RLOUT},
  
  -   {DMic Rate 64, NULL, Mic Bias},
  -   {Mic Bias, NULL, DMic},
  +   {DMic Rate 64, NULL, DMic},
  +   {DMic, NULL, Mic Bias},
  
  {b LINE2R, NULL, MONO_LOUT},
  {Earphone, NULL, b HPLOUT},
  
  -   {LINE1L, NULL, b Mic Bias},
  -   {b Mic Bias, NULL, HS Mic}
  +   {LINE1L, NULL, HS Mic},
  +   {HS Mic, NULL, b Mic Bias},
  
   };
   
   static const char * const spk_function[] = {Off, On};

Can you try DT and non-DT boot of 3.19? If there is difference?

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


Re: 3.19 on Nokia n900: audio quality awful

2015-01-30 Thread Pavel Machek
Hi!

   diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
   index 04896d6252a2..7f299357c2d2 100644
   --- a/sound/soc/omap/rx51.c
   +++ b/sound/soc/omap/rx51.c
   @@ -250,14 +250,14 @@ static const struct snd_soc_dapm_route
   audio_map[] = {
   
 {FM Transmitter, NULL, LLOUT},
 {FM Transmitter, NULL, RLOUT},
   
   - {DMic Rate 64, NULL, Mic Bias},
   - {Mic Bias, NULL, DMic},
   + {DMic Rate 64, NULL, DMic},
   + {DMic, NULL, Mic Bias},
   
 {b LINE2R, NULL, MONO_LOUT},
 {Earphone, NULL, b HPLOUT},
   
   - {LINE1L, NULL, b Mic Bias},
   - {b Mic Bias, NULL, HS Mic}
   + {LINE1L, NULL, HS Mic},
   + {HS Mic, NULL, b Mic Bias},
   
};

static const char * const spk_function[] = {Off, On};
 
 Can you try DT and non-DT boot of 3.19? If there is difference?

Audio recording now works for me. No, I could not get non-DT boot of
3.19 to work :-(.

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/7] extcon: usb-gpio: Introduce gpio usb extcon driver

2015-01-30 Thread Roger Quadros
On 29/01/15 18:56, Tony Lindgren wrote:
 * Roger Quadros rog...@ti.com [150129 03:34]:
 On 28/01/15 19:09, Tony Lindgren wrote:
 * Roger Quadros rog...@ti.com [150128 04:15]:
 On 28/01/15 04:19, Chanwoo Choi wrote:

 I still fail to understand that we need to call disable_irq() in 
 .suspend() and
 enable_irq() in .resume()

 can you point me to any other drivers doing so?

 You can refer the suspend function in drivers/mfd/max14577.c or 
 drivers/mfd/max77693.c.
 The max14577_suspend() includes the detailed comment for why using 
 disable_irq() in suspend function.

 In max14577 case, max14577_suspend() use disable_irq() function because 
 of i2c dependency.
 If max14577 device is wake-up from suspend state before completing the 
 resume sequence
 of i2c, max14577 may fail to read/write i2c communication.

 Thanks for this information. I will add disable/enable_irq() in 
 suspend/resume().

 Are the .dts changes safe for me to apply already?


 Yes Tony, you can pick them. Thanks.
 
 OK will apply the dts changes into omap-for-v3.20/dt thanks.
 I have also the defconfig changes tagged, will apply those
 a bit later probably as a fix after the driver is merged.

Sounds good to me. Thanks Tony.

cheers,
-roger
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 3.19 on Nokia n900: audio quality awful

2015-01-30 Thread Peter Ujfalusi
On 01/30/2015 02:40 PM, Peter Ujfalusi wrote:
 On 01/30/2015 12:37 PM, Pavel Machek wrote:
 Hi!

 I looked around the diff between 3.18 and 3.19, reverted these, and
 audio quality is back to reasonable level.

 Actually, reverting 368494093354ac613a80c2e1d77602aa12473cf0 seems
 enough.

 Any quick patches to test? Or should we revert so that 3.19-final
 works ok?
 
 I'll send the fix in a minute, thanks for finding it ;)

And here it is:
http://mailman.alsa-project.org/pipermail/alsa-devel/2015-January/087228.html

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/7] usb: extcon: Fix USB-Host cable name

2015-01-30 Thread Roger Quadros
Felipe  Chanwoo,

On 26/01/15 14:15, Roger Quadros wrote:
 The recommended name for USB-Host cable state is USB-Host and not
 USB-HOST as per drivers/extcon/extcon-class.c extcon_cable_name.
 
 Change all instances of USB-HOST to USB-Host.
 
 Signed-off-by: Roger Quadros rog...@ti.com
 Reviewed-by: Felipe Balbi ba...@ti.com
 Acked-by: Felipe Balbi ba...@ti.com

This patch has no dependency to the rest so can be picked up as soon as 
possible.

Do you think it is better to go via the USB tree?
If yes then Chanwoo, can you please Ack this one? Thanks.

This would mean that only the first patch needs to go through extcon tree as 
Tony
will pick the rest.

cheers,
-roger

 ---
  drivers/extcon/extcon-palmas.c | 18 +-
  drivers/usb/dwc3/dwc3-omap.c   |  6 +++---
  drivers/usb/phy/phy-omap-otg.c |  4 ++--
  drivers/usb/phy/phy-tahvo.c|  8 
  4 files changed, 18 insertions(+), 18 deletions(-)
 
 diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
 index 11c6757..6d002c3 100644
 --- a/drivers/extcon/extcon-palmas.c
 +++ b/drivers/extcon/extcon-palmas.c
 @@ -31,7 +31,7 @@
  
  static const char *palmas_extcon_cable[] = {
   [0] = USB,
 - [1] = USB-HOST,
 + [1] = USB-Host,
   NULL,
  };
  
 @@ -93,26 +93,26 @@ static irqreturn_t palmas_id_irq_handler(int irq, void 
 *_palmas_usb)
   PALMAS_USB_ID_INT_LATCH_CLR,
   PALMAS_USB_ID_INT_EN_HI_CLR_ID_GND);
   palmas_usb-linkstat = PALMAS_USB_STATE_ID;
 - extcon_set_cable_state(palmas_usb-edev, USB-HOST, true);
 - dev_info(palmas_usb-dev, USB-HOST cable is attached\n);
 + extcon_set_cable_state(palmas_usb-edev, USB-Host, true);
 + dev_info(palmas_usb-dev, USB-Host cable is attached\n);
   } else if ((set  PALMAS_USB_ID_INT_SRC_ID_FLOAT) 
   (id_src  PALMAS_USB_ID_INT_SRC_ID_FLOAT)) {
   palmas_write(palmas_usb-palmas, PALMAS_USB_OTG_BASE,
   PALMAS_USB_ID_INT_LATCH_CLR,
   PALMAS_USB_ID_INT_EN_HI_CLR_ID_FLOAT);
   palmas_usb-linkstat = PALMAS_USB_STATE_DISCONNECT;
 - extcon_set_cable_state(palmas_usb-edev, USB-HOST, false);
 - dev_info(palmas_usb-dev, USB-HOST cable is detached\n);
 + extcon_set_cable_state(palmas_usb-edev, USB-Host, false);
 + dev_info(palmas_usb-dev, USB-Host cable is detached\n);
   } else if ((palmas_usb-linkstat == PALMAS_USB_STATE_ID) 
   (!(set  PALMAS_USB_ID_INT_SRC_ID_GND))) {
   palmas_usb-linkstat = PALMAS_USB_STATE_DISCONNECT;
 - extcon_set_cable_state(palmas_usb-edev, USB-HOST, false);
 - dev_info(palmas_usb-dev, USB-HOST cable is detached\n);
 + extcon_set_cable_state(palmas_usb-edev, USB-Host, false);
 + dev_info(palmas_usb-dev, USB-Host cable is detached\n);
   } else if ((palmas_usb-linkstat == PALMAS_USB_STATE_DISCONNECT) 
   (id_src  PALMAS_USB_ID_INT_SRC_ID_GND)) {
   palmas_usb-linkstat = PALMAS_USB_STATE_ID;
 - extcon_set_cable_state(palmas_usb-edev, USB-HOST, true);
 - dev_info(palmas_usb-dev,  USB-HOST cable is attached\n);
 + extcon_set_cable_state(palmas_usb-edev, USB-Host, true);
 + dev_info(palmas_usb-dev,  USB-Host cable is attached\n);
   }
  
   return IRQ_HANDLED;
 diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
 index 172d64e..6713ad9 100644
 --- a/drivers/usb/dwc3/dwc3-omap.c
 +++ b/drivers/usb/dwc3/dwc3-omap.c
 @@ -445,14 +445,14 @@ static int dwc3_omap_extcon_register(struct dwc3_omap 
 *omap)
  
   omap-id_nb.notifier_call = dwc3_omap_id_notifier;
   ret = extcon_register_interest(omap-extcon_id_dev,
 -edev-name, USB-HOST,
 +edev-name, USB-Host,
  omap-id_nb);
   if (ret  0)
 - dev_vdbg(omap-dev, failed to register notifier for 
 USB-HOST\n);
 + dev_vdbg(omap-dev, failed to register notifier for 
 USB-Host\n);
  
   if (extcon_get_cable_state(edev, USB) == true)
   dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
 - if (extcon_get_cable_state(edev, USB-HOST) == true)
 + if (extcon_get_cable_state(edev, USB-Host) == true)
   dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
   }
  
 diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c
 index 56ee760..53cba3f 100644
 --- a/drivers/usb/phy/phy-omap-otg.c
 +++ b/drivers/usb/phy/phy-omap-otg.c
 @@ -119,7 +119,7 @@ static int omap_otg_probe(struct platform_device *pdev)
   otg_dev-vbus_nb.notifier_call = omap_otg_vbus_notifier;
  
   ret = 

Re: [PATCH v3 1/7] extcon: usb-gpio: Introduce gpio usb extcon driver

2015-01-30 Thread Roger Quadros
Chanwoo,

On 30/01/15 02:06, Chanwoo Choi wrote:
 Hi Roger,
 
 On 01/29/2015 08:26 PM, Roger Quadros wrote:
 Chanwoo,

 On 29/01/15 03:49, Chanwoo Choi wrote:
 Hi Roger,

 We need to discuss one point about 'id_irqwake'.
 I don't recommend to use 'id_irqwake' field.

 And I catch build warning by using select keywork in Kconfig.
 It is my wrong guide of select keyword. So, I'll change it 
 as 'depends on' keyword.

 Looks good to me except for 'id_irqwake'. 
 I'll apply this patch on 3.21 queue after completing this discussion.

 On 01/28/2015 09:15 PM, Roger Quadros wrote:
 This driver observes the USB ID pin connected over a GPIO and
 updates the USB cable extcon states accordingly.

 The existing GPIO extcon driver is not suitable for this purpose
 as it needs to be taught to understand USB cable states and it
 can't handle more than one cable per instance.

 For the USB case we need to handle 2 cable states.
 1) USB (attach/detach)
 2) USB-Host (attach/detach)

 This driver can be easily updated in the future to handle VBUS
 events in case it happens to be available on GPIO for any platform.

 Signed-off-by: Roger Quadros rog...@ti.com
 ---
 v3:
 - removed IRQF_NO_SUSPEND flag. Added IRQF_TRIGGER_RISING and
   IRQF_TRIGGER_FALLING
 - Added disable_irq() to suspend() and enable_irq() to resume()

  .../devicetree/bindings/extcon/extcon-usb-gpio.txt |  18 ++
  drivers/extcon/Kconfig |   7 +
  drivers/extcon/Makefile|   1 +
  drivers/extcon/extcon-usb-gpio.c   | 233 
 +
  4 files changed, 259 insertions(+)
  create mode 100644 
 Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
  create mode 100644 drivers/extcon/extcon-usb-gpio.c

 diff --git a/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt 
 b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 new file mode 100644
 index 000..85fe6b0
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 @@ -0,0 +1,18 @@
 +USB GPIO Extcon device
 +
 +This is a virtual device used to generate USB cable states from the USB 
 ID pin
 +connected to a GPIO pin.
 +
 +Required properties:
 +- compatible: Should be linux,extcon-usb-gpio
 +- id-gpio: gpio for USB ID pin. See gpio binding.
 +
 +Example:
 +  extcon_usb1 {
 +  compatible = linux,extcon-usb-gpio;
 +  id-gpio = gpio6 1 GPIO_ACTIVE_HIGH;
 +  }
 +
 +  omap_dwc3_1 {
 +  extcon = extcon_usb1;
 +  };
 diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
 index 6a1f7de..fd11536 100644
 --- a/drivers/extcon/Kconfig
 +++ b/drivers/extcon/Kconfig
 @@ -93,4 +93,11 @@ config EXTCON_SM5502
  Silicon Mitus SM5502. The SM5502 is a USB port accessory
  detector and switch.
  
 +config EXTCON_USB_GPIO
 +  tristate USB GPIO extcon support
 +  select GPIOLIB

 I catch the build warning if using 'select' instead of 'depends on' as 
 following:
 It is my wrong guide to you. So, I'll modify it by using depends on as 
 your original patch.

 OK. Thanks.


 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage  -j 8
 scripts/kconfig/conf --silentoldconfig Kconfig
 drivers/gpio/Kconfig:34:error: recursive dependency detected!
 drivers/gpio/Kconfig:34:symbol GPIOLIB is selected by EXTCON_USB_GPIO
 drivers/extcon/Kconfig:96:  symbol EXTCON_USB_GPIO depends on EXTCON
 drivers/extcon/Kconfig:1:   symbol EXTCON is selected by CHARGER_MANAGER
 drivers/power/Kconfig:316:  symbol CHARGER_MANAGER depends on POWER_SUPPLY
 drivers/power/Kconfig:1:symbol POWER_SUPPLY is selected by HID_SONY
 drivers/hid/Kconfig:670:symbol HID_SONY depends on NEW_LEDS
 drivers/leds/Kconfig:8: symbol NEW_LEDS is selected by BCMA_DRIVER_GPIO
 drivers/bcma/Kconfig:75:symbol BCMA_DRIVER_GPIO depends on GPIOLIB

 +  help
 +Say Y here to enable GPIO based USB cable detection extcon support.
 +Used typically if GPIO is used for USB ID pin detection.
 +
  endif # MULTISTATE_SWITCH
 diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
 index 0370b42..6a08a98 100644
 --- a/drivers/extcon/Makefile
 +++ b/drivers/extcon/Makefile
 @@ -12,3 +12,4 @@ obj-$(CONFIG_EXTCON_MAX8997) += extcon-max8997.o
  obj-$(CONFIG_EXTCON_PALMAS)   += extcon-palmas.o
  obj-$(CONFIG_EXTCON_RT8973A)  += extcon-rt8973a.o
  obj-$(CONFIG_EXTCON_SM5502)   += extcon-sm5502.o
 +obj-$(CONFIG_EXTCON_USB_GPIO) += extcon-usb-gpio.o
 diff --git a/drivers/extcon/extcon-usb-gpio.c 
 b/drivers/extcon/extcon-usb-gpio.c
 new file mode 100644
 index 000..99a58b2
 --- /dev/null
 +++ b/drivers/extcon/extcon-usb-gpio.c
 @@ -0,0 +1,233 @@
 +/**
 + * drivers/extcon/extcon-usb-gpio.c - USB GPIO extcon driver
 + *
 + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
 + * Author: Roger Quadros rog...@ti.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 

Re: 3.19 on Nokia n900: audio quality awful

2015-01-30 Thread Peter Ujfalusi
On 01/30/2015 12:37 PM, Pavel Machek wrote:
 Hi!
 
 I looked around the diff between 3.18 and 3.19, reverted these, and
 audio quality is back to reasonable level.
 
 Actually, reverting 368494093354ac613a80c2e1d77602aa12473cf0 seems
 enough.
 
 Any quick patches to test? Or should we revert so that 3.19-final
 works ok?

I'll send the fix in a minute, thanks for finding it ;)

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html