Re: [PATCH v2 02/10] i2c: OMAP: Add DT support for i2c controller

2011-12-22 Thread Shubhrajyoti
Since it touches the driver file
+linux-i2c
On Friday 09 December 2011 07:32 PM, Benoit Cousson wrote:
 Add initial DT support to retrieve the frequency using a
 DT attribute instead of the pdata pointer if of_node exist.

 Add documentation for omap i2c controller binding.

 Based on original patches from Manju and Grant.

 Signed-off-by: Benoit Cousson b-cous...@ti.com
 Cc: Ben Dooks ben-li...@fluff.org
 ---
  Documentation/devicetree/bindings/i2c/omap-i2c.txt |   42 
  drivers/i2c/busses/i2c-omap.c  |  100 
 +---
  2 files changed, 107 insertions(+), 35 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt

 diff --git a/Documentation/devicetree/bindings/i2c/omap-i2c.txt 
 b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
 new file mode 100644
 index 000..d259a17
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
 @@ -0,0 +1,42 @@
 +I2C for OMAP platforms
 +
 +Required properties :
 +- compatible : Must be ti,omap3-i2c or ti,omap4-i2c
 +- ti,hwmods : Must be i2cn, n being the instance number (1-based)
 +- #address-cells = 1;
 +- #size-cells = 0;
 +
 +Recommended properties :
 +- clock-frequency : Desired I2C bus clock frequency in Hz. Otherwise
 +  the default 100 kHz frequency will be used.
 +
 +Optional properties:
 +- Child nodes conforming to i2c bus binding
 +- ti,flags : u32: settings or errata relative to the i2c
 +0x1:   OMAP_I2C_FLAG_NO_FIFO
 +0x2:   OMAP_I2C_FLAG_SIMPLE_CLOCK
 +0x4:   OMAP_I2C_FLAG_16BIT_DATA_REG
 +0x8:   OMAP_I2C_FLAG_RESET_REGS_POSTIDLE
 +0x10:  OMAP_I2C_FLAG_APPLY_ERRATA_I207
 +0x20:  OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK
 +0x40:  OMAP_I2C_FLAG_FORCE_19200_INT_CLK
 +  Valid for ti,omap3-i2c only:
 +0x80:  OMAP_I2C_FLAG_BUS_SHIFT_1: 8 bits registers
 +0x100: OMAP_I2C_FLAG_BUS_SHIFT_2: 16 bits registers
 +
 +Note: Current implementation will fetch base address, irq and dma
 +from omap hwmod data base during device registration.
 +Future plan is to migrate hwmod data base contents into device tree
 +blob so that, all the required data will be used from device tree dts
 +file.
 +
 +Examples :
 +
 +i2c1: i2c@0 {
 +compatible = ti,omap3-i2c;
 +#address-cells = 1;
 +#size-cells = 0;
 +ti,hwmods = i2c1;
 +clock-frequency = 40;
 +ti,flags = 0x118;
 +};
 diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
 index a43d002..b4a8eee 100644
 --- a/drivers/i2c/busses/i2c-omap.c
 +++ b/drivers/i2c/busses/i2c-omap.c
 @@ -37,6 +37,8 @@
  #include linux/platform_device.h
  #include linux/clk.h
  #include linux/io.h
 +#include linux/of_i2c.h
 +#include linux/of_device.h
  #include linux/slab.h
  #include linux/i2c-omap.h
  #include linux/pm_runtime.h
 @@ -182,7 +184,9 @@ struct omap_i2c_dev {
   u32 latency;/* maximum mpu wkup latency */
   void(*set_mpu_wkup_lat)(struct device *dev,
   long latency);
 - u32 speed;  /* Speed of bus in Khz */
 + u32 speed;  /* Speed of bus in kHz */
 + u32 dtrev;  /* extra revision from DT */
 + u32 flags;
   u16 cmd_err;
   u8  *buf;
   u8  *regs;
 @@ -266,11 +270,7 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev 
 *i2c_dev, int reg)
  
  static void omap_i2c_unidle(struct omap_i2c_dev *dev)
  {
 - struct omap_i2c_bus_platform_data *pdata;
 -
 - pdata = dev-dev-platform_data;
 -
 - if (pdata-flags  OMAP_I2C_FLAG_RESET_REGS_POSTIDLE) {
 + if (dev-flags  OMAP_I2C_FLAG_RESET_REGS_POSTIDLE) {
   omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
   omap_i2c_write_reg(dev, OMAP_I2C_PSC_REG, dev-pscstate);
   omap_i2c_write_reg(dev, OMAP_I2C_SCLL_REG, dev-scllstate);
 @@ -291,13 +291,10 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
  
  static void omap_i2c_idle(struct omap_i2c_dev *dev)
  {
 - struct omap_i2c_bus_platform_data *pdata;
   u16 iv;
  
 - pdata = dev-dev-platform_data;
 -
   dev-iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
 - if (pdata-rev == OMAP_I2C_IP_VERSION_2)
 + if (dev-dtrev == OMAP_I2C_IP_VERSION_2)
   omap_i2c_write_reg(dev, OMAP_I2C_IP_V2_IRQENABLE_CLR, 1);
   else
   omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
 @@ -320,9 +317,6 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
   unsigned long timeout;
   unsigned long internal_clk = 0;
   struct clk *fclk;
 - struct omap_i2c_bus_platform_data *pdata;
 -
 - pdata = dev-dev-platform_data;
  
   if (dev-rev = OMAP_I2C_OMAP1_REV_2) {
   /* Disable I2C controller before soft reset */
 @@ -373,7 +367,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
 

Re: [linux-pm] [PATCH 0/3] coupled cpuidle state support

2011-12-22 Thread Shilimkar, Santosh
On Thu, Dec 22, 2011 at 1:12 AM, Colin Cross ccr...@android.com wrote:
 On Wed, Dec 21, 2011 at 11:36 AM, Arjan van de Ven
 ar...@linux.intel.com wrote:

 .. or it enters WFI, and a physical device sends it an interrupt,
 at which point it exits.

 None of the cpus will return to the idle loop until all cpus have
 decremented the ready counter back to 0, so they can't wrap around
 again.


 yikes, so you IPI all the cpus on the first exit.
 that must burn power ;-(

 No, you're not understanding the point of this series.

 If your cpus can go in and out of idle independently, you don't use
 this code at all.  Each cpu can call WFI and come back out without
 talking to the other cpu.

Indeed. The SOCs, Arch's which does support low power
state independently and doesn't need any co-ordination between CPU's
will continue to work same way as before with this series.

 However, if you have two cpus that share some part of the SoC that can
 be turned off in idle, like the L2 cache controller or the system bus,
 the two cpus need to go to idle together, and they will both boot
 together when either one receives an interrupt (although one will
 likely immediately go back to a shallower state that doesn't require
 coordination with the other cpu).  There is no way around this, it's
 how the hardware works on some ARM platforms.

Apart from shared peripherals which Colin pointed out, OMAP also
brings in the security software state which is kind of executing in
parallel with linux. This state is lost in certain deeper low power
states and since the security software is affine to only master CPU
(because of OMAP security architecture), the co-ordination is
mandatory to achieve those low power states.

So this additional CPU co-ordination logic for such C-states
really helps to solve the issue in most generic way.

Regards
Santosh
--
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] OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided

2011-12-22 Thread Igor Grinberg
On 12/21/11 20:06, Ilya Yanok wrote:
 Hi Igor,
 
 On 21.12.2011 21:22, Igor Grinberg wrote:
 Please, Cc the linux-arm-ker...@lists.infradead.org for patches,
 so Tony, or whoever will not need to resend them...
 
 Uh.. Actually I thought that linux-omap ML is a good place for really
 OMAP-specific patches like this one and there is no much sense posting
 such patches into the main ARM list...
 
 Ok, I will Cc linux-arm-kernel in future.
 
 If platform data is provided by the caller gpio_pendown is put into
 unused static ads7846_config structure and effectively has no effect.
 Of course caller can set gpio_pendown field in platform data himself
 but it seems natural to do this in ads7846_init to remove duplication.

 Signed-off-by: Ilya Yanok ya...@emcraft.com
 ---
  arch/arm/mach-omap2/common-board-devices.c |5 -
  1 files changed, 4 insertions(+), 1 deletions(-)

 diff --git a/arch/arm/mach-omap2/common-board-devices.c 
 b/arch/arm/mach-omap2/common-board-devices.c
 index 2d1d775..eb408dd 100644
 --- a/arch/arm/mach-omap2/common-board-devices.c
 +++ b/arch/arm/mach-omap2/common-board-devices.c
 @@ -75,7 +75,10 @@ void __init omap_ads7846_init(int bus_num, int 
 gpio_pendown, int gpio_debounce,
 gpio_set_debounce(gpio_pendown, gpio_debounce);
 }
  
 -   ads7846_config.gpio_pendown = gpio_pendown;
 +   if (!board_pdata)
 +   ads7846_config.gpio_pendown = gpio_pendown;
 +   else
 +   board_pdata-gpio_pendown = gpio_pendown;
  
 spi_bi-bus_num = bus_num;
 spi_bi-irq = OMAP_GPIO_IRQ(gpio_pendown);

 The fact that the ads7846_config has no effect in case
 the board_pdata is provided does not really meter...
 How about reusing the existing if instead of adding another one?
 Like in the attached patch?
 
 Yes, I think your version is a bit clearer. Probably it makes to add
 else clause and move ads7846_config.gpio_pendown assignment under it.

Sounds fine, care to send a v2?
You can add my SOB.


-- 
Regards,
Igor.
--
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: Is Pandaboard cpuhotplug working stably?

2011-12-22 Thread Shilimkar, Santosh
+ Peter Z

On Wed, Dec 21, 2011 at 3:37 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Wed, Dec 21, 2011 at 05:59:07PM +0800, Barry Song wrote:
 2011/12/21 Russell King - ARM Linux li...@arm.linux.org.uk:
  cpu hotplug is basically totally buggered - the preconditions placed
  upon the bringup code path are basically impossible to satisfy in any
  shape or form at the moment.
 
  There's the requirement that the secondary CPU is marked online and
  active before interrupts are enabled for the thread migration stuff
  to behave correctly.  However, this is incompatible with 
  smp_call_function()
  which will wait for online CPUs to respond to an IPI - which this one
  won't because interrupts are disabled.
 
  I think there was some discussion about how to fix this but I don't
  recall the details.

 thanks, Russell. then could i think this is an ARM-kernel-specific bug
 which exists on all ARM SMP chips for the moment?
 and that bug doesn't happen on x86:

 I don't think so.  There's nothing ARM specific about it.

There are few patches floating around for this issue. I posted one version
long back [1] and then there was one more form Thomas G.
The most recent is from one is from Peter Z [2] which is moving the
fix for the cup online race to core code.

Can you try Peter's patch with your test-case ?

Regards,
Santosh

[1] https://lkml.org/lkml/2011/6/20/79
[2] https://lkml.org/lkml/2011/12/15/255
--
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: [linux-pm] [PATCH 0/3] coupled cpuidle state support

2011-12-22 Thread Arjan van de Ven
On 12/22/2011 9:35 AM, Shilimkar, Santosh wrote:

 Indeed. The SOCs, Arch's which does support low power
 state independently and doesn't need any co-ordination between CPU's
 will continue to work same way as before with this series.

btw I think you misunderstand; I don't object to a need for something
like this, I am just very concerned that this may not be possible to be
done in a race-free way.


--
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 02/11] i2c: OMAP: Add DT support for i2c controller

2011-12-22 Thread Cousson, Benoit

Hi Rob,

On 12/20/2011 5:42 PM, Rob Herring wrote:

On 12/20/2011 10:27 AM, Benoit Cousson wrote:

Add initial DT support to retrieve the frequency using a
DT attribute instead of the pdata pointer if of_node exist.

Add documentation for omap i2c controller binding.

Based on original patches from Manju and Grant.

Signed-off-by: Benoit Coussonb-cous...@ti.com
Cc: Ben Dooksben-li...@fluff.org
Cc: Kevin Hilmankhil...@ti.com


One issue below, otherwise:

Reviewed-by: Rob Herringrob.herr...@calxeda.com



@@ -1001,15 +1019,24 @@ omap_i2c_probe(struct platform_device *pdev)
goto err_release_region;
}

-   if (pdata != NULL) {
-   speed = pdata-clkrate;
+   match = of_match_device(omap_i2c_of_match,pdev-dev);
+   if (match) {
+   u32 freq = 10; /* default to 10 Hz */
+
+   pdata = match-data;
+   dev-dtrev = pdata-rev;
+   dev-flags = pdata-flags;
+
+   of_property_read_u32(node, clock-frequency,freq);
+   /* convert DT freq value in Hz into kHz for speed */
+   dev-speed = freq / 1000;
+   } else if (pdata != NULL) {
+   dev-speed = pdata-clkrate;
+   dev-flags = pdata-flags;
dev-set_mpu_wkup_lat = pdata-set_mpu_wkup_lat;
-   } else {
-   speed = 100;/* Default speed */
-   dev-set_mpu_wkup_lat = NULL;
+   dev-dtrev = pdata-rev;


If you get here, pdata is NULL.


Mmm, it should not. It's true that the patch is not super readable, but 
here is the result:


if (match) {
u32 freq = 10; /* default to 10 Hz */

pdata = match-data;
dev-dtrev = pdata-rev;
dev-flags = pdata-flags;

of_property_read_u32(node, clock-frequency, freq);
/* convert DT freq value in Hz into kHz for speed */
dev-speed = freq / 1000;
} else if (pdata != NULL) {
dev-speed = pdata-clkrate;
dev-flags = pdata-flags;
dev-set_mpu_wkup_lat = pdata-set_mpu_wkup_lat;
dev-dtrev = pdata-rev;
}

I removed every other pdata reference after this point.

Regards,
Benoit
--
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 07/10] ASoC: OMAP: ams-delta: Drive modem/codec pins over GPIO API

2011-12-22 Thread Girdwood, Liam
On 21 December 2011 22:14, Janusz Krzysztofik jkrzy...@tis.icnet.pl wrote:
 On Wednesday 21 of December 2011 at 19:33:44, Liam Girdwood wrote:
 On Sun, 2011-12-11 at 21:12 +0100, Janusz Krzysztofik wrote:
  Don't use Amstrad Delta custom I/O functions any longer, replace them
  with GPIO. Old pin definitions, no longer used by the modem bits either,
  can be dropped.
 
  Depends on patch 2/10 ARM: OMAP1: Convert Amstrad E3 latches to
  basic_mmio_gpio.
 
  Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl

 Applied.

 Hi,
 I'm sorry, but I've probably missed to infrom you explicitly, i.e. other
 than in a cover letter to v2 of this series, that this particular patch
 has been dropped from the series. I've already started working on an
 alternative solution, which I intend to submit as a separate set. It
 will be free of potentail problems with two devices, a modem and the
 sound card, accessing the same GPIO pins concurrently. For the
 MODEM_NRESET pin I've already set up a virtual regulator on top of it,
 and for the MODEM_CODEC pin I'll probably choose a virtual clock (pinmux
 would match the hardware more closely here, but it looks too complicated
 to me). Moreover, I've already started to move all those GPIO pin
 related functions, i.e. bias control, digital mute and line discipline
 interaction, from the board file to the codec driver, where all those
 seem to belong.

 Having this patch applied will conflict with the regultor and the clock
 solutions, taking control over those two GPIO pins. Please revert this
 patch, or reset it if still possible.

 Thanks,
 Janusz

Will do, I never pushed last night as it was late. So I'll only will
have to make a local change.

Thanks

Liam
--
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: [RFC PATCH v2 4/8] media: videobuf2: introduce VIDEOBUF2_PAGE memops

2011-12-22 Thread Marek Szyprowski
Hello,

On Wednesday, December 14, 2011 3:00 PM Ming Lei wrote:

 DMA contig memory resource is very limited and precious, also
 accessing to it from CPU is very slow on some platform.
 
 For some cases(such as the comming face detection driver), DMA Streaming
 buffer is enough, so introduce VIDEOBUF2_PAGE to allocate continuous
 physical memory but letting video device driver to handle DMA buffer mapping
 and unmapping things.
 
 Signed-off-by: Ming Lei ming@canonical.com

Could you elaborate a bit why do you think that DMA contig memory resource
is so limited? If dma_alloc_coherent fails because of the memory fragmentation,
the alloc_pages() call with order  0 will also fail.

I understand that there might be some speed issues with coherent (uncached)
userspace mappings, but I would solve it in completely different way. The 
interface
for both coherent/uncached and non-coherent/cached contig allocator should be 
the
same, so exchanging them is easy and will not require changes in the driver.
I'm planning to introduce some design changes in memory allocator api and 
introduce
prepare and finish callbacks in allocator ops. I hope to post the rfc after
Christmas. For your face detection driver using standard dma-contig allocator
shouldn't be a big issue.

Your current implementation also abuses the design and api of videobuf2 memory
allocators. If the allocator needs to return a custom structure to the driver
you should use cookie method. vaddr is intended to provide only a pointer to
kernel virtual mapping, but you pass a struct page * there.

(snipped)

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center



--
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: [linux-pm] [PATCH 0/3] coupled cpuidle state support

2011-12-22 Thread Shilimkar, Santosh
On Thu, Dec 22, 2011 at 2:23 PM, Arjan van de Ven ar...@linux.intel.com wrote:
 On 12/22/2011 9:35 AM, Shilimkar, Santosh wrote:

 Indeed. The SOCs, Arch's which does support low power
 state independently and doesn't need any co-ordination between CPU's
 will continue to work same way as before with this series.

 btw I think you misunderstand; I don't object to a need for something
 like this,
I did. Thanks for clarification.

 I am just very concerned that this may not be possible to be
 done in a race-free way.

I agree to those races but may be they are harmless.
Also the safe state need not be just WFI and can be bit deeper
where the co-ordination between isn't necessary. So that should
still not burn the power that much.

For simplicity let's assume a two CPU scenario.
Ideal scenario:
CPU 1 has entered idle and incremented counter for the
co-ordinated C state. CPU0 also enter and increments the
counter and now the subsystem and interconnect can go
down along with CPU cluster.

Few of the race conditions will possibly lead to void
the above conditions  and in that case the counter would
reflect that and such a C-state won't be attempted and
a safe C-state would be attempted. That should still work
fine.

Some how this hardware/security restriction is bit stupid
and likely going against the existing CPUIDLE design
which expect that a CPUIDLE thread are per CPU and it should
be independent and local to that CPU.

Regards
Santosh
--
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] OMAP3: hwmod_data: add HWMOD_INIT_NO_RESET flag for dss_dispc

2011-12-22 Thread Tomi Valkeinen
On Thu, 2011-12-22 at 02:00 +0100, Ilya Yanok wrote:
 Resetting DISPC when a DISPC output is enabled causes the DSS to go into
 an inconsistent state.
 
 commit b923d40dd4211c4ef7d4efa2bd81b7ca1d8744c1
 Author: Archit Taneja arc...@ti.com
 Date:   Thu Oct 6 18:04:08 2011 -0600
 
 ARM: OMAP2PLUS: DSS: Ensure DSS works correctly if display is
 enabled in bootloader
 
 tries to deal with this problem by checking if display is enabled and
 disabling it before doing reset.
 
 But in my setup dss_dispc is resetted from omap_hwmod_setup_all function
 _before_ calling omap_dss_reset. So when dispc_disable_outputs is
 executed dispc is already reset and nothing happens.

Hmm, why is that? You don't have the dss hwmod before dispc in the list
of hwmods? The code presumes that dss hwmod is handled first.

 This patch and HWMOD_INIT_NO_RESET flags to dss_dispc hwmod thus leaving
 DISPC untouched so that omap_dss_reset can take care of it.

omap_dss_reset() doesn't reset dispc, so this will leave dispc
un-reseted.

The idea of the current code is to do the reset similarly on all OMAPs.
The sequence should be:

- omap_dss_reset(), which disables dispc outputs and manually resets dss
registers.
- then the rest of the dss modules reset themselves normally, using the
softreset bit.

Your patch would break that.

 Tomi



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


Re: Is Pandaboard cpuhotplug working stably?

2011-12-22 Thread Russell King - ARM Linux
On Thu, Dec 22, 2011 at 02:19:23PM +0530, Shilimkar, Santosh wrote:
 + Peter Z
 
 On Wed, Dec 21, 2011 at 3:37 PM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
  On Wed, Dec 21, 2011 at 05:59:07PM +0800, Barry Song wrote:
  2011/12/21 Russell King - ARM Linux li...@arm.linux.org.uk:
   cpu hotplug is basically totally buggered - the preconditions placed
   upon the bringup code path are basically impossible to satisfy in any
   shape or form at the moment.
  
   There's the requirement that the secondary CPU is marked online and
   active before interrupts are enabled for the thread migration stuff
   to behave correctly.  However, this is incompatible with 
   smp_call_function()
   which will wait for online CPUs to respond to an IPI - which this one
   won't because interrupts are disabled.
  
   I think there was some discussion about how to fix this but I don't
   recall the details.
 
  thanks, Russell. then could i think this is an ARM-kernel-specific bug
  which exists on all ARM SMP chips for the moment?
  and that bug doesn't happen on x86:
 
  I don't think so.  There's nothing ARM specific about it.
 
 There are few patches floating around for this issue. I posted one version
 long back [1] and then there was one more form Thomas G.
 The most recent is from one is from Peter Z [2] which is moving the
 fix for the cup online race to core code.
 
 Can you try Peter's patch with your test-case ?
 
 Regards,
 Santosh
 
 [1] https://lkml.org/lkml/2011/6/20/79
 [2] https://lkml.org/lkml/2011/12/15/255

[1] is already fixed - and is not the latest problem with this code.
Fixing the problem in [1] actually itself created the latest problem
with smp_call_function() which wasn't there before this change.  Patch
[2] refers to this problem and proposes a fix for it.
--
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: Is Pandaboard cpuhotplug working stably?

2011-12-22 Thread Shilimkar, Santosh
On Thu, Dec 22, 2011 at 3:54 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Thu, Dec 22, 2011 at 02:19:23PM +0530, Shilimkar, Santosh wrote:
 + Peter Z

 On Wed, Dec 21, 2011 at 3:37 PM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
  On Wed, Dec 21, 2011 at 05:59:07PM +0800, Barry Song wrote:
  2011/12/21 Russell King - ARM Linux li...@arm.linux.org.uk:
   cpu hotplug is basically totally buggered - the preconditions placed
   upon the bringup code path are basically impossible to satisfy in any
   shape or form at the moment.
  
   There's the requirement that the secondary CPU is marked online and
   active before interrupts are enabled for the thread migration stuff
   to behave correctly.  However, this is incompatible with 
   smp_call_function()
   which will wait for online CPUs to respond to an IPI - which this one
   won't because interrupts are disabled.
  
   I think there was some discussion about how to fix this but I don't
   recall the details.
 
  thanks, Russell. then could i think this is an ARM-kernel-specific bug
  which exists on all ARM SMP chips for the moment?
  and that bug doesn't happen on x86:
 
  I don't think so.  There's nothing ARM specific about it.

 There are few patches floating around for this issue. I posted one version
 long back [1] and then there was one more form Thomas G.
 The most recent is from one is from Peter Z [2] which is moving the
 fix for the cup online race to core code.

 Can you try Peter's patch with your test-case ?

 Regards,
 Santosh

 [1] https://lkml.org/lkml/2011/6/20/79
 [2] https://lkml.org/lkml/2011/12/15/255

 [1] is already fixed - and is not the latest problem with this code.
 Fixing the problem in [1] actually itself created the latest problem
 with smp_call_function() which wasn't there before this change.  Patch
 [2] refers to this problem and proposes a fix for it.

Thanks Russell for information. Looks like I missed in between thread.

Regards
Santosh
--
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 v2] ARM: OMAP1: ams-delta: register latch dependent devices later

2011-12-22 Thread Janusz Krzysztofik
On Wednesday 21 of December 2011 at 21:07:29, Tony Lindgren wrote:
 * Janusz Krzysztofik jkrzy...@tis.icnet.pl [111221 11:20]:
  On Wednesday 21 of December 2011 at 20:08:15, Tony Lindgren wrote:
   * Janusz Krzysztofik jkrzy...@tis.icnet.pl [111220 13:23]:
In preparation to converting Amstrad Delta on-board latches to
basic_mmio_gpio devices, registration of platform devices which depend
on latches and will require initialization of their GPIO pins first,
should be moved out of .machine_init down to late_initcall level, as the
gpio-generic driver is not available until device_initcall time.  The
latch reset operation, which will be replaced with GPIO initialization,
must also be moved to late_initcall for the same reason.

Since there was already another, separate arch_initcall function for
setting up one of those latch dependent devices, the on-board modem
device, reuse that function, i.e., rename it to a name that matches the
new purpose, extend with other device setup relocated from
.machine_init, and move down to the late_initcall level.

While being at it, add missing gpio_free() in case the modem platform
device registration fails.

Thanks to Tony Lindgren t...@atomide.com who suggested this approach
instead of shifting up the gpio-generic driver initialization.

In addition, defer registration of the Amstrad Delta ASoC and serio
devices, done from their device driver files, until late_initcall time,
as those drivers will depend on their GPIO pins already requested from
the board late_init() function until updated to register their GPIO pins
themselves.

Created and tested against linux-3.2-rc6.

Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl
   
   Planning to apply this series. Dmitry, care to ack the 
   drivers/input/serio/
   related change?
  
  Don't we need Jarkko's or Mark's or Liam's ack as well for the change to 
  the sound/soc/omap/ams-delta.c file?
 
 Yes, you're right.

Jarkko, Mark or Liam, care to ack this change, moving the Amstrad Delta 
sound card registration to late_initcall?

Thanks,
Janusz

Changes since the initial version of this patch:
* use late_initcall() unconditionally in modules, requested by Russell
  King (thanks!); an updated patch 7/7 will follow,
* in the changelog message, move credits to Tony up a bit, since the
  person responsible for other changes (he might not necessarily like)
  is me, not him ;).

Comments copied from this patch initial submission:
This patch was not present in the initial submission, it replaces the
old patch 1/10, providing an alternative solution not touching the
gpio-generic driver.

 arch/arm/mach-omap1/board-ams-delta.c |   28 

 drivers/input/serio/ams_delta_serio.c |2 +-
 sound/soc/omap/ams-delta.c|2 +-
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap1/board-ams-delta.c 
b/arch/arm/mach-omap1/board-ams-delta.c
index b0f15d2..50987c9 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -275,11 +275,14 @@ static struct omap1_cam_platform_data 
ams_delta_camera_platform_data = {
 };
 
 static struct platform_device *ams_delta_devices[] __initdata = {
-   ams_delta_nand_device,
ams_delta_kp_device,
+   ams_delta_camera_device,
+};
+
+static struct platform_device *late_devices[] __initdata = {
+   ams_delta_nand_device,
ams_delta_lcd_device,
ams_delta_led_device,
-   ams_delta_camera_device,
 };
 
 static void __init ams_delta_init(void)
@@ -307,9 +310,6 @@ static void __init ams_delta_init(void)
omap_serial_init();
omap_register_i2c_bus(1, 100, NULL, 0);
 
-   /* Clear latch2 (NAND, LCD, modem enable) */
-   ams_delta_latch2_write(~0, 0);
-
omap1_usb_init(ams_delta_usb_config);
omap1_set_camera_info(ams_delta_camera_platform_data);
 #ifdef CONFIG_LEDS_TRIGGERS
@@ -345,13 +345,18 @@ static struct platform_device 
ams_delta_modem_device = {
},
 };
 
-static int __init ams_delta_modem_init(void)
+static int __init late_init(void)
 {
int err;
 
if (!machine_is_ams_delta())
return -ENODEV;
 
+   /* Clear latch2 (NAND, LCD, modem enable) */
+   ams_delta_latch2_write(~0, 0);
+
+   platform_add_devices(late_devices, ARRAY_SIZE(late_devices));
+
omap_cfg_reg(M14_1510_GPIO2);
ams_delta_modem_ports[0].irq =
gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
@@ -367,9 +372,16 @@ static int __init ams_delta_modem_init(void)

Re: [PATCH v2 1/7 v2] ARM: OMAP1: ams-delta: register latch dependent devices later

2011-12-22 Thread Jarkko Nikula

On 12/22/2011 12:39 PM, Janusz Krzysztofik wrote:


Don't we need Jarkko's or Mark's or Liam's ack as well for the change to
the sound/soc/omap/ams-delta.c file?


Yes, you're right.


Jarkko, Mark or Liam, care to ack this change, moving the Amstrad Delta
sound card registration to late_initcall?

Unfortunately I haven't had time to look at the series but I'm fine with 
sound/soc/omap/ams-delta.c change.


--
Jarkko
--
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 v2] ARM: OMAP1: ams-delta: register latch dependent devices later

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 01:08:12PM +0200, Jarkko Nikula wrote:
 On 12/22/2011 12:39 PM, Janusz Krzysztofik wrote:

Guys *please* delete irrelevant context from mails.  I wasn't reading
any of the rest of it since nothing about the subject line says anything
about anything relevant and there was no content anywhere near the start
of the actual mails.  I only saw this because Jarkko did trim the
context.

 Jarkko, Mark or Liam, care to ack this change, moving the Amstrad Delta
 sound card registration to late_initcall?

 Unfortunately I haven't had time to look at the series but I'm fine
 with sound/soc/omap/ams-delta.c change.

Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
--
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] OMAP3: hwmod_data: add HWMOD_INIT_NO_RESET flag for dss_dispc

2011-12-22 Thread Ilya Yanok
Hi Tomi,

On 22.12.2011 14:13, Tomi Valkeinen wrote:
 On Thu, 2011-12-22 at 02:00 +0100, Ilya Yanok wrote:
 Resetting DISPC when a DISPC output is enabled causes the DSS to go into
 an inconsistent state.

 commit b923d40dd4211c4ef7d4efa2bd81b7ca1d8744c1
 Author: Archit Taneja arc...@ti.com
 Date:   Thu Oct 6 18:04:08 2011 -0600

 ARM: OMAP2PLUS: DSS: Ensure DSS works correctly if display is
 enabled in bootloader

 tries to deal with this problem by checking if display is enabled and
 disabling it before doing reset.

 But in my setup dss_dispc is resetted from omap_hwmod_setup_all function
 _before_ calling omap_dss_reset. So when dispc_disable_outputs is
 executed dispc is already reset and nothing happens.
 
 Hmm, why is that? You don't have the dss hwmod before dispc in the list
 of hwmods? The code presumes that dss hwmod is handled first.

Looking at the arch/arm/mach-omap2/omap_hwmod_3xxx_data.c I can see that
dss_dispc is in the list of generic hwmods which is registered first
while dss_core hwmod is in revision-specific lists which are registered
later. I think this is the real root of the problem, thanks for pointing
this out!

 
 This patch and HWMOD_INIT_NO_RESET flags to dss_dispc hwmod thus leaving
 DISPC untouched so that omap_dss_reset can take care of it.
 
 omap_dss_reset() doesn't reset dispc, so this will leave dispc
 un-reseted.
 
 The idea of the current code is to do the reset similarly on all OMAPs.
 The sequence should be:
 
 - omap_dss_reset(), which disables dispc outputs and manually resets dss
 registers.
 - then the rest of the dss modules reset themselves normally, using the
 softreset bit.

But currently omap_dss_reset() is called the last.

Regards, Ilya.
--
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/9] OMAP4: ASoC: Support for PandaBoard family

2011-12-22 Thread Peter Ujfalusi
Hello,

the following series will add ASoC support for PandaBoards.
PandaBoards have different audio routings compared to SDP4430/Blaze boards, but
the differences not that big to justify a new ASoC machine driver.

This series is based on the first three patch from the v1 sereis (those, which
has been applied by Liam).

Changes since v1:
As suggested by Mark the platform data, machine driver has been converted to
process feature flags instead of Board IDs.
- The ASoC machine driver registers all DAPM widgets. Based on the received
  configuration it will disable the unused paths
- PCM for dmic is only created, if the board has digital mic conencted
- Jack functionality will be only used on boards supporting it
- Sound card name for SDP4430 has net been changed

Regards,
Peter
---
Peter Ujfalusi (9):
  include: platform_data: Platform data header for OMAP4 ASoC audio
  OMAP4: 4430sdp: Register platform device for OMAP4 audio
  ASoC: omap-abe-twl6040: Convert to platform deriver
  ASoC: twl6040: Convert MICBIAS to SUPPLY widget
  ASoC: omap-abe-twl6040: Add complete DAPM routing
  ASoC: omap-abe-twl6040: DAI link selection based on platform data
  ASoC: omap-abe-twl6040: Configure card according to platform data
  OMAP4: omap4panda: Enable audio support
  ASoC: Kconfig: OMAP4: Enable support for PandaBoards

 arch/arm/mach-omap2/board-4430sdp.c|   27 
 arch/arm/mach-omap2/board-omap4panda.c |   56 -
 include/linux/platform_data/omap-abe-twl6040.h |   48 +++
 sound/soc/codecs/twl6040.c |   16 +-
 sound/soc/omap/Kconfig |5 +-
 sound/soc/omap/omap-abe-twl6040.c  |  178 
 6 files changed, 260 insertions(+), 70 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

-- 
1.7.8.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 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Peter Ujfalusi
Include file to be used with the upcoming ASoC machine driver
for OMAP platform using ABE with twl6040 codec.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 include/linux/platform_data/omap-abe-twl6040.h |   48 
 1 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

diff --git a/include/linux/platform_data/omap-abe-twl6040.h 
b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644
index 000..286f644
--- /dev/null
+++ b/include/linux/platform_data/omap-abe-twl6040.h
@@ -0,0 +1,48 @@
+/**
+ * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Author: Peter Ujfalusi peter.ujfal...@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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _OMAP_ABE_TWL6040_H_
+#define _OMAP_ABE_TWL6040_H_
+
+/* To select if only one channel is connected in a stereo port */
+#define ABE_TWL6040_LEFT   (1  0)
+#define ABE_TWL6040_RIGHT  (1  1)
+
+struct omap_abe_twl6040_data {
+   char *card_name;
+   /* Feature flags for connected audio pins */
+   u8  has_hs;
+   u8  has_hf;
+   boolhas_ep;
+   u8  has_aux;
+   u8  has_vibra;
+   boolhas_dmic;
+   boolhas_hsmic;
+   boolhas_mainmic;
+   boolhas_submic;
+   u8  has_afm;
+   /* Other features */
+   booljack_detection; /* board can detect jack events */
+};
+
+#endif /* _OMAP_ABE_TWL6040_H_ */
-- 
1.7.8.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 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio

2011-12-22 Thread Peter Ujfalusi
To avoid breakage in audio support with the coming change
in ASoC machine driver (conversion to platfrom device).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 21b62bd..394cbab 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -41,6 +41,7 @@
 #include video/omap-panel-nokia-dsi.h
 #include video/omap-panel-picodlp.h
 #include linux/wl12xx.h
+#include linux/platform_data/omap-abe-twl6040.h
 
 #include mux.h
 #include hsmmc.h
@@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
.id = -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+   .card_name = SDP4430,
+   .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_ep = 1,
+   .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_vibra  = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+   .has_dmic   = 1,
+   .has_hsmic  = 1,
+   .has_mainmic= 1,
+   .has_submic = 1,
+   .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+   .jack_detection = 1,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+   .name   = omap-abe-twl6040,
+   .id = -1,
+   .dev = {
+   .platform_data = sdp4430_abe_audio_data,
+   },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_gpio_keys_device,
sdp4430_leds_gpio,
sdp4430_leds_pwm,
sdp4430_vbat,
sdp4430_dmic_codec,
+   sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.8.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 3/9] ASoC: omap-abe-twl6040: Convert to platform deriver

2011-12-22 Thread Peter Ujfalusi
Convert the OMAP4 ABE/TWL6040 machine driver to platform
driver.
For the card name use the string provided via platform data.
The card's name for OMAP4 SDP4430 has been changed:
SDP4430 - OMAP4-SDP4430

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   59 ++--
 1 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 9c6d97a..4974ea1 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -23,6 +23,7 @@
 #include linux/clk.h
 #include linux/platform_device.h
 #include linux/mfd/twl6040.h
+#include linux/platform_data/omap-abe-twl6040.h
 #include linux/module.h
 
 #include sound/core.h
@@ -226,7 +227,6 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
 
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-   .name = SDP4430,
.dai_link = sdp4430_dai,
.num_links = ARRAY_SIZE(sdp4430_dai),
 
@@ -236,43 +236,56 @@ static struct snd_soc_card omapabe_card = {
.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
-static struct platform_device *omapabe_snd_device;
-
-static int __init omapabe_soc_init(void)
+static __devinit int omapabe_probe(struct platform_device *pdev)
 {
+   struct omap_abe_twl6040_data *pdata = dev_get_platdata(pdev-dev);
+   struct snd_soc_card *card = omapabe_card;
int ret;
 
-   if (!machine_is_omap_4430sdp())
-   return -ENODEV;
-   printk(KERN_INFO SDP4430 SoC init\n);
+   card-dev = pdev-dev;
 
-   omapabe_snd_device = platform_device_alloc(soc-audio, -1);
-   if (!omapabe_snd_device) {
-   printk(KERN_ERR Platform device allocation failed\n);
-   return -ENOMEM;
+   if (!pdata) {
+   dev_err(pdev-dev, Missing pdata\n);
+   return -ENODEV;
}
 
-   platform_set_drvdata(omapabe_snd_device, omapabe_card);
+   if (pdata-card_name) {
+   card-name = pdata-card_name;
+   } else {
+   dev_err(pdev-dev, Card name is not provided\n);
+   return -ENODEV;
+   }
 
-   ret = platform_device_add(omapabe_snd_device);
+   ret = snd_soc_register_card(card);
if (ret)
-   goto err;
-
-   return 0;
+   dev_err(pdev-dev, snd_soc_register_card() failed: %d\n,
+   ret);
 
-err:
-   printk(KERN_ERR Unable to add platform device\n);
-   platform_device_put(omapabe_snd_device);
return ret;
 }
-module_init(omapabe_soc_init);
 
-static void __exit omapabe_soc_exit(void)
+static int __devexit omapabe_remove(struct platform_device *pdev)
 {
-   platform_device_unregister(omapabe_snd_device);
+   struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+   snd_soc_unregister_card(card);
+
+   return 0;
 }
-module_exit(omapabe_soc_exit);
+
+static struct platform_driver omapabe_driver = {
+   .driver = {
+   .name = omap-abe-twl6040,
+   .owner = THIS_MODULE,
+   .pm = snd_soc_pm_ops,
+   },
+   .probe = omapabe_probe,
+   .remove = __devexit_p(omapabe_remove),
+};
+
+module_platform_driver(omapabe_driver);
 
 MODULE_AUTHOR(Misael Lopez Cruz misael.lo...@ti.com);
 MODULE_DESCRIPTION(ALSA SoC for OMAP boards with ABE and twl6040 codec);
 MODULE_LICENSE(GPL);
+MODULE_ALIAS(platform:omap-abe-twl6040);
-- 
1.7.8.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 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Peter Ujfalusi
In order to avoid breakage change the omap-abe-twl6040
machine driver's routing.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c|   16 
 sound/soc/omap/omap-abe-twl6040.c |   14 +++---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a4a65dc..2be98e8 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1102,14 +1102,14 @@ static const struct snd_soc_dapm_widget 
twl6040_dapm_widgets[] = {
TWL6040_REG_MICRCTL, 2, 0),
 
/* Microphone bias */
-   SND_SOC_DAPM_MICBIAS(Headset Mic Bias,
-   TWL6040_REG_AMICBCTL, 0, 0),
-   SND_SOC_DAPM_MICBIAS(Main Mic Bias,
-   TWL6040_REG_AMICBCTL, 4, 0),
-   SND_SOC_DAPM_MICBIAS(Digital Mic1 Bias,
-   TWL6040_REG_DMICBCTL, 0, 0),
-   SND_SOC_DAPM_MICBIAS(Digital Mic2 Bias,
-   TWL6040_REG_DMICBCTL, 4, 0),
+   SND_SOC_DAPM_SUPPLY(Headset Mic Bias,
+   TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Main Mic Bias,
+   TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Digital Mic1 Bias,
+   TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Digital Mic2 Bias,
+   TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
 
/* DACs */
SND_SOC_DAPM_DAC(HSDAC Left, Headset Playback, SND_SOC_NOPM, 0, 0),
diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 4974ea1..18a25b0 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -123,17 +123,17 @@ static const struct snd_soc_dapm_widget 
twl6040_dapm_widgets[] = {
 
 static const struct snd_soc_dapm_route audio_map[] = {
/* External Mics: MAINMIC, SUBMIC with bias*/
-   {MAINMIC, NULL, Main Mic Bias},
-   {SUBMIC, NULL, Main Mic Bias},
-   {Main Mic Bias, NULL, Ext Mic},
+   {MAINMIC, NULL, Ext Mic},
+   {SUBMIC, NULL, Ext Mic},
+   {Ext Mic, NULL, Main Mic Bias},
 
/* External Speakers: HFL, HFR */
{Ext Spk, NULL, HFL},
{Ext Spk, NULL, HFR},
 
/* Headset Mic: HSMIC with bias */
-   {HSMIC, NULL, Headset Mic Bias},
-   {Headset Mic Bias, NULL, Headset Mic},
+   {HSMIC, NULL, Headset Mic},
+   {Headset Mic, NULL, Headset Mic Bias},
 
/* Headset Stereophone (Headphone): HSOL, HSOR */
{Headset Stereophone, NULL, HSOL},
@@ -182,8 +182,8 @@ static const struct snd_soc_dapm_widget dmic_dapm_widgets[] 
= {
 };
 
 static const struct snd_soc_dapm_route dmic_audio_map[] = {
-   {DMic, NULL, Digital Mic1 Bias},
-   {Digital Mic1 Bias, NULL, Digital Mic},
+   {DMic, NULL, Digital Mic},
+   {Digital Mic, NULL, Digital Mic1 Bias},
 };
 
 static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.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 5/9] ASoC: omap-abe-twl6040: Add complete DAPM routing

2011-12-22 Thread Peter Ujfalusi
SDP4430 is a reference platform, and as such it has all possible
audio routing implemented.
Correct the DAPM routing to be complete.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   46 ++--
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 18a25b0..cf3cb08 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -113,38 +113,48 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
 
 /* SDP4430 machine DAPM */
 static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
-   SND_SOC_DAPM_MIC(Ext Mic, NULL),
-   SND_SOC_DAPM_SPK(Ext Spk, NULL),
-   SND_SOC_DAPM_MIC(Headset Mic, NULL),
+   /* Outputs */
SND_SOC_DAPM_HP(Headset Stereophone, NULL),
SND_SOC_DAPM_SPK(Earphone Spk, NULL),
-   SND_SOC_DAPM_INPUT(FM Stereo In),
+   SND_SOC_DAPM_SPK(Ext Spk, NULL),
+   SND_SOC_DAPM_LINE(Line Out, NULL),
+   SND_SOC_DAPM_SPK(Vibrator, NULL),
+
+   /* Inputs */
+   SND_SOC_DAPM_MIC(Headset Mic, NULL),
+   SND_SOC_DAPM_MIC(Main Handset Mic, NULL),
+   SND_SOC_DAPM_MIC(Sub Handset Mic, NULL),
+   SND_SOC_DAPM_LINE(Line In, NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
-   /* External Mics: MAINMIC, SUBMIC with bias*/
-   {MAINMIC, NULL, Ext Mic},
-   {SUBMIC, NULL, Ext Mic},
-   {Ext Mic, NULL, Main Mic Bias},
+   /* Routings for outputs */
+   {Headset Stereophone, NULL, HSOL},
+   {Headset Stereophone, NULL, HSOR},
+
+   {Earphone Spk, NULL, EP},
 
-   /* External Speakers: HFL, HFR */
{Ext Spk, NULL, HFL},
{Ext Spk, NULL, HFR},
 
-   /* Headset Mic: HSMIC with bias */
+   {Line Out, NULL, AUXL},
+   {Line Out, NULL, AUXR},
+
+   {Vibrator, NULL, VIBRAL},
+   {Vibrator, NULL, VIBRAR},
+
+   /* Routings for inputs */
{HSMIC, NULL, Headset Mic},
{Headset Mic, NULL, Headset Mic Bias},
 
-   /* Headset Stereophone (Headphone): HSOL, HSOR */
-   {Headset Stereophone, NULL, HSOL},
-   {Headset Stereophone, NULL, HSOR},
+   {MAINMIC, NULL, Main Handset Mic},
+   {Main Handset Mic, NULL, Main Mic Bias},
 
-   /* Earphone speaker */
-   {Earphone Spk, NULL, EP},
+   {SUBMIC, NULL, Sub Handset Mic},
+   {Sub Handset Mic, NULL, Main Mic Bias},
 
-   /* Aux/FM Stereo In: AFML, AFMR */
-   {AFML, NULL, FM Stereo In},
-   {AFMR, NULL, FM Stereo In},
+   {AFML, NULL, Line In},
+   {AFMR, NULL, Line In},
 };
 
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.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 6/9] ASoC: omap-abe-twl6040: DAI link selection based on platform data

2011-12-22 Thread Peter Ujfalusi
We can have machines without DMIC connected. In this case there is
no need to create amother (unusable) capture PCM on the card.
The existence of the DMIC connection can be checked via
pdata-has_dmic.
Select the correct dai_link structure for the card based on
pdata-has_dmic.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   26 ++
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index cf3cb08..9e6e4c2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -212,7 +212,7 @@ static int omapabe_dmic_init(struct snd_soc_pcm_runtime 
*rtd)
 }
 
 /* Digital audio interface glue - connects codec -- CPU */
-static struct snd_soc_dai_link sdp4430_dai[] = {
+static struct snd_soc_dai_link twl6040_dmic_dai[] = {
{
.name = TWL6040,
.stream_name = TWL6040,
@@ -235,11 +235,21 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
},
 };
 
+static struct snd_soc_dai_link twl6040_only_dai[] = {
+   {
+   .name = TWL6040,
+   .stream_name = TWL6040,
+   .cpu_dai_name = omap-mcpdm,
+   .codec_dai_name = twl6040-legacy,
+   .platform_name = omap-pcm-audio,
+   .codec_name = twl6040-codec,
+   .init = omapabe_twl6040_init,
+   .ops = omapabe_ops,
+   },
+};
+
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-   .dai_link = sdp4430_dai,
-   .num_links = ARRAY_SIZE(sdp4430_dai),
-
.dapm_widgets = twl6040_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets),
.dapm_routes = audio_map,
@@ -266,6 +276,14 @@ static __devinit int omapabe_probe(struct platform_device 
*pdev)
return -ENODEV;
}
 
+   if (pdata-has_dmic) {
+   card-dai_link = twl6040_dmic_dai;
+   card-num_links = ARRAY_SIZE(twl6040_dmic_dai);
+   } else {
+   card-dai_link = twl6040_only_dai;
+   card-num_links = ARRAY_SIZE(twl6040_only_dai);
+   }
+
ret = snd_soc_register_card(card);
if (ret)
dev_err(pdev-dev, snd_soc_register_card() failed: %d\n,
-- 
1.7.8.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 7/9] ASoC: omap-abe-twl6040: Configure card according to platform data

2011-12-22 Thread Peter Ujfalusi
Disable the not connected pins on the board based on the
received platform data.
DO not register the jack function on boards, which does not have
means to detect it (jack is always connected).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   41 ++--
 1 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 9e6e4c2..7a8fbe2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -157,10 +157,29 @@ static const struct snd_soc_dapm_route audio_map[] = {
{AFMR, NULL, Line In},
 };
 
+#define twl6040_disconnect_pin(dapm, connected, pin)   \
+   if (!connected) \
+   snd_soc_dapm_disable_pin(dapm, pin);
+
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 {
struct snd_soc_codec *codec = rtd-codec;
-   int ret, hs_trim;
+   struct snd_soc_card *card = codec-card;
+   struct snd_soc_dapm_context *dapm = codec-dapm;
+   struct omap_abe_twl6040_data *pdata = dev_get_platdata(card-dev);
+   int hs_trim;
+   int ret = 0;
+
+   /* Disable not connected paths if not used */
+   twl6040_disconnect_pin(dapm, pdata-has_hs, Headset Stereophone);
+   twl6040_disconnect_pin(dapm, pdata-has_hf, Ext Spk);
+   twl6040_disconnect_pin(dapm, pdata-has_ep, Earphone Spk);
+   twl6040_disconnect_pin(dapm, pdata-has_aux, Line Out);
+   twl6040_disconnect_pin(dapm, pdata-has_vibra, Vinrator);
+   twl6040_disconnect_pin(dapm, pdata-has_hsmic, Headset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_mainmic, Main Handset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_submic, Sub Handset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_afm, Line In);
 
/*
 * Configure McPDM offset cancellation based on the HSOTRIM value from
@@ -170,19 +189,17 @@ static int omapabe_twl6040_init(struct 
snd_soc_pcm_runtime *rtd)
omap_mcpdm_configure_dn_offsets(rtd, TWL6040_HSF_TRIM_LEFT(hs_trim),
TWL6040_HSF_TRIM_RIGHT(hs_trim));
 
-   /* Headset jack detection */
-   ret = snd_soc_jack_new(codec, Headset Jack,
-   SND_JACK_HEADSET, hs_jack);
-   if (ret)
-   return ret;
-
-   ret = snd_soc_jack_add_pins(hs_jack, ARRAY_SIZE(hs_jack_pins),
-   hs_jack_pins);
+   /* Headset jack detection only if it is supported */
+   if (pdata-jack_detection) {
+   ret = snd_soc_jack_new(codec, Headset Jack,
+   SND_JACK_HEADSET, hs_jack);
+   if (ret)
+   return ret;
 
-   if (machine_is_omap_4430sdp())
+   ret = snd_soc_jack_add_pins(hs_jack, ARRAY_SIZE(hs_jack_pins),
+   hs_jack_pins);
twl6040_hs_jack_detect(codec, hs_jack, SND_JACK_HEADSET);
-   else
-   snd_soc_jack_report(hs_jack, SND_JACK_HEADSET, 
SND_JACK_HEADSET);
+   }
 
return ret;
 }
-- 
1.7.8.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 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Peter Ujfalusi
PandaBoard has twl6040 codec for audio.
Register the omap4-abe-twl6040 platform device.
Add platform data to enable the twl6040 codec.
Since there is a difference in audio between  PandaBoard 4430
and PandaBoard ES (4460):
Use different name for the sound card:
OMAP4-Panda for PandaBoard 4430
OMAP4-PandaES for PandaBoard ES

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com

board: audio for panda
---
 arch/arm/mach-omap2/board-omap4panda.c |   56 +++-
 1 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index b6f1144..cb843fc 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -28,6 +28,7 @@
 #include linux/regulator/machine.h
 #include linux/regulator/fixed.h
 #include linux/wl12xx.h
+#include linux/platform_data/omap-abe-twl6040.h
 
 #include mach/hardware.h
 #include asm/hardware/gic.h
@@ -90,9 +91,31 @@ static struct platform_device leds_gpio = {
},
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+   /* Audio out */
+   .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* HandsFree through expasion connector */
+   .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
+   .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* PandaBoard: FM RX, PandaBoardES: audio in */
+   .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* No jack detection. */
+   .jack_detection = 0,
+};
+
+static struct platform_device panda_abe_audio = {
+   .name   = omap-abe-twl6040,
+   .id = -1,
+   .dev = {
+   .platform_data = panda_abe_audio_data,
+   },
+};
+
 static struct platform_device *panda_devices[] __initdata = {
leds_gpio,
wl1271_device,
+   panda_abe_audio,
 };
 
 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
@@ -251,8 +274,25 @@ static int __init omap4_twl6030_hsmmc_init(struct 
omap2_hsmmc_info *controllers)
return 0;
 }
 
+static struct twl4030_codec_data twl6040_codec = {
+   /* single-step ramp for headset and handsfree */
+   .hs_left_step   = 0x0f,
+   .hs_right_step  = 0x0f,
+   .hf_left_step   = 0x1d,
+   .hf_right_step  = 0x1d,
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+   .codec  = twl6040_codec,
+   .audpwron_gpio  = 127,
+   .naudint_irq= OMAP44XX_IRQ_SYS_2N,
+   .irq_base   = TWL6040_CODEC_IRQ_BASE,
+};
+
 /* Panda board uses the common PMIC configuration */
-static struct twl4030_platform_data omap4_panda_twldata;
+static struct twl4030_platform_data omap4_panda_twldata = {
+   .audio  = twl6040_audio,
+};
 
 /*
  * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -548,6 +588,19 @@ void omap4_panda_display_init(void)
omap_display_init(omap4_panda_dss_data);
 }
 
+static void omap4_panda_audio_init(void)
+{
+   if (cpu_is_omap4430()) {
+   /* PandaBoard 4430 */
+   panda_abe_audio_data.card_name = PandaBoard;
+   /* Audio in is connected to HSMIC */
+   panda_abe_audio_data.has_hsmic = 1;
+   } else {
+   /* PandaBoard ES */
+   panda_abe_audio_data.card_name = PandaBoardES;
+   }
+}
+
 static void __init omap4_panda_init(void)
 {
int package = OMAP_PACKAGE_CBS;
@@ -560,6 +613,7 @@ static void __init omap4_panda_init(void)
pr_err(error setting wl12xx data\n);
 
omap4_panda_i2c_init();
+   omap4_panda_audio_init();
platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
platform_device_register(omap_vwlan_device);
board_serial_init();
-- 
1.7.8.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 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards

2011-12-22 Thread Peter Ujfalusi
Enable the ASoC audio support for PandaBoard family via
teh omap-abe-twl6040 machine driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/Kconfig |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 98410b8..2d19119 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -99,7 +99,8 @@ config SND_OMAP_SOC_SDP3430
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
tristate SoC Audio support for OMAP boards using ABE and twl6040 codec
-   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP_4430SDP
+   depends on TWL4030_CORE  SND_OMAP_SOC
+   depends on MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
select SND_OMAP_SOC_DMIC
select SND_OMAP_SOC_MCPDM
select SND_SOC_TWL6040
@@ -108,6 +109,8 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
  Say Y if you want to add support for SoC audio on OMAP boards using
  ABE and twl6040 codec. This driver currently supports:
  - SDP4430/Blaze boards
+ - PandaBoard (4430)
+ - PandaBoardES (4460)
 
 config SND_OMAP_SOC_OMAP4_HDMI
tristate SoC Audio support for Texas Instruments OMAP4 HDMI
-- 
1.7.8.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 v2 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 02:42:40PM +0200, Peter Ujfalusi wrote:

  include/linux/platform_data/omap-abe-twl6040.h |   48 
 

omap-abe-mcpdm-twl6040 please.  Seriously, just drop the abe - it's not
an optional feature of the OMAP and the names are getting quite long.
--
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 7/9] ASoC: omap-abe-twl6040: Configure card according to platform data

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 02:42:46PM +0200, Peter Ujfalusi wrote:

 +#define twl6040_disconnect_pin(dapm, connected, pin) \
 + if (!connected) \
 + snd_soc_dapm_disable_pin(dapm, pin);
 +

This should be a function for legibility and type safety.
--
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 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 02:42:47PM +0200, Peter Ujfalusi wrote:

 +static void omap4_panda_audio_init(void)
 +{
 + if (cpu_is_omap4430()) {
 + /* PandaBoard 4430 */
 + panda_abe_audio_data.card_name = PandaBoard;
 + /* Audio in is connected to HSMIC */
 + panda_abe_audio_data.has_hsmic = 1;
 + } else {
 + /* PandaBoard ES */
 + panda_abe_audio_data.card_name = PandaBoardES;

Is audio the only difference between the two boards?  If there's more
stuff it might be more sensible to have a single place which decides
what the differences are rather than scattering it in various places.
--
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 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 02:42:48PM +0200, Peter Ujfalusi wrote:

  config SND_OMAP_SOC_OMAP_ABE_TWL6040
   tristate SoC Audio support for OMAP boards using ABE and twl6040 codec
 - depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP_4430SDP
 + depends on TWL4030_CORE  SND_OMAP_SOC
 + depends on MACH_OMAP_4430SDP || MACH_OMAP4_PANDA

Given that it's now a platform device and there's a reasonable
expectation that there will be lots of other boards derived from this
it'd seem sensible to just remove the machine dependencies so people
don't have to patch the Kconfig.  Otherwise it kind of defeats the point
of making the code generic.
--
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] OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided

2011-12-22 Thread Ilya Yanok
If platform data is provided by the caller gpio_pendown is put into
unused static ads7846_config structure and effectively has no effect.
Of course caller can set gpio_pendown field in platform data himself
but it seems natural to do this in ads7846_init to remove duplication.

Signed-off-by: Igor Grinberg grinb...@compulab.co.il
Signed-off-by: Ilya Yanok ya...@emcraft.com

---
Changes from V1:

 - existing if clause reused

 arch/arm/mach-omap2/common-board-devices.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/common-board-devices.c 
b/arch/arm/mach-omap2/common-board-devices.c
index 2d1d775..9498b0f 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -75,13 +75,15 @@ void __init omap_ads7846_init(int bus_num, int 
gpio_pendown, int gpio_debounce,
gpio_set_debounce(gpio_pendown, gpio_debounce);
}
 
-   ads7846_config.gpio_pendown = gpio_pendown;
-
spi_bi-bus_num = bus_num;
spi_bi-irq = OMAP_GPIO_IRQ(gpio_pendown);
 
-   if (board_pdata)
+   if (board_pdata) {
+   board_pdata-gpio_pendown = gpio_pendown;
spi_bi-platform_data = board_pdata;
+   } else {
+   ads7846_config.gpio_pendown = gpio_pendown;
+   }
 
spi_register_board_info(ads7846_spi_board_info, 1);
 }
-- 
1.7.6.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: [PATCH v3 02/11] i2c: OMAP: Add DT support for i2c controller

2011-12-22 Thread Cousson, Benoit

Hi Olof,

On 12/20/2011 10:24 PM, Olof Johansson wrote:

Hi,

On Tue, Dec 20, 2011 at 8:27 AM, Benoit Coussonb-cous...@ti.com  wrote:


diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index a43d002..dcbc1ec 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -37,6 +37,8 @@
  #includelinux/platform_device.h
  #includelinux/clk.h
  #includelinux/io.h
+#includelinux/of_i2c.h
+#includelinux/of_device.h
  #includelinux/slab.h
  #includelinux/i2c-omap.h
  #includelinux/pm_runtime.h

[...]

@@ -1165,6 +1195,7 @@ static struct platform_driver omap_i2c_driver = {
.name   = omap_i2c,
.owner  = THIS_MODULE,
.pm = OMAP_I2C_PM_OPS,
+   .of_match_table = of_match_ptr(omap_i2c_of_match),
},
  };


of_match_ptr() comes fromlinux/of.h, so you need to include that to
not break !CONFIG_OF builds.


Good point, I'll fix that.

Thanks,
Benoit
--
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] OMAP3: hwmod_data: register dss hwmods after dss_core

2011-12-22 Thread Ilya Yanok
dss_core has to be initialized before any other DSS hwmod. Currently
this is broken as dss_core is listed in chip/revision specific hwmod
lists while other DSS hwmods are listed in common list which is
registered first.

This patch moves DSS hwmods (except for dss_core) to the separate list
which is registered last to ensure that dss_core is already registered.

CC: Tomi Valkeinen tomi.valkei...@ti.com
CC: Archit Taneja arc...@ti.com
CC: Paul Walmsley p...@pwsan.com
Signed-off-by: Ilya Yanok ya...@emcraft.com
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   20 ++--
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 5324e8d..85536ff 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3523,12 +3523,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = 
{
omap3xxx_uart2_hwmod,
omap3xxx_uart3_hwmod,
 
-   /* dss class */
-   omap3xxx_dss_dispc_hwmod,
-   omap3xxx_dss_dsi1_hwmod,
-   omap3xxx_dss_rfbi_hwmod,
-   omap3xxx_dss_venc_hwmod,
-
/* i2c class */
omap3xxx_i2c1_hwmod,
omap3xxx_i2c2_hwmod,
@@ -3635,6 +3629,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = {
NULL
 };
 
+static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
+   /* dss class */
+   omap3xxx_dss_dispc_hwmod,
+   omap3xxx_dss_dsi1_hwmod,
+   omap3xxx_dss_rfbi_hwmod,
+   omap3xxx_dss_venc_hwmod,
+   NULL
+};
+
 int __init omap3xxx_hwmod_init(void)
 {
int r;
@@ -3708,6 +3711,11 @@ int __init omap3xxx_hwmod_init(void)
 
if (h)
r = omap_hwmod_register(h);
+   if (r  0)
+   return r;
+
+   /* Register common DSS hwmods later than dss_core */
+   r = omap_hwmod_register(omap3xxx_dss_hwmods);
 
return r;
 }
-- 
1.7.6.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: [PATCH v2 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Peter Ujfalusi
On 12/22/2011 03:24 PM, Mark Brown wrote:
 Is audio the only difference between the two boards?  If there's more
 stuff it might be more sensible to have a single place which decides
 what the differences are rather than scattering it in various places.

I'm not sure, I have only checked the audio. But there could be other
differences.
I'll make this as a generic function.

-- 
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 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 02:42:43PM +0200, Peter Ujfalusi wrote:
 In order to avoid breakage change the omap-abe-twl6040
 machine driver's routing.

I was going to apply this but it doesn't apply against current code...
--
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 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Peter Ujfalusi
On 12/22/2011 04:15 PM, Mark Brown wrote:
 On Thu, Dec 22, 2011 at 02:42:43PM +0200, Peter Ujfalusi wrote:
 In order to avoid breakage change the omap-abe-twl6040
 machine driver's routing.
 
 I was going to apply this but it doesn't apply against current code...

Yes, because I is touching the machine driver as well (after the rename)
to avoid breakage.

-- 
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


[PATCH v4 00/12] OMAP4: Add DT support for i2c and twl6030

2011-12-22 Thread Benoit Cousson
Hi Tony and Rob,

Here is the updated version of the i2c + twl DT adaptation series.

This update, compared to v3 [1], is fixing the twl-core build for non-OMAP
platform.
Per Olof's suggestion, adding the of.h include in the i2c driver to avoid
problem in case on non-DT build.

Patches are based on for_3.3/2_dt_irq, to get the latest GIC binding,
and are available here:
git://gitorious.org/omap-pm/linux.git for_3.3/3_omap_dt_i2c_twl

Tested on Beagle and sdp4430. Build tested for x86.

Comments are welcome.

Regards,
Benoit

[1] http://www.spinics.net/lists/linux-omap/msg62127.html

Benoit Cousson (12):
  ARM: OMAP2+: pm: Do not init statically the SR and voltage layer with DT
  i2c: OMAP: Add DT support for i2c controller
  mfd: twl-core: Add initial DT support for twl4030/twl6030
  rtc: rtc-twl: Add DT support for RTC inside twl4030/twl6030
  arm/dts: OMAP4: Add i2c controller nodes
  arm/dts: OMAP3: Add i2c controller nodes
  arm/dts: twl6030: Add DTS file for twl6030 PMIC
  arm/dts: twl4030: Add DTS file for twl4030 PM + Audio IC
  arm/dts: omap4-panda: Add twl6030 and i2c EEPROM
  arm/dts: omap4-sdp: Add twl6030, i2c3 and i2c4 devices
  arm/dts: omap3-beagle: Add twl4030 and i2c EEPROM
  ARM: OMAP2+: board-generic: Remove i2c static init

 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   30 ++
 .../devicetree/bindings/mfd/twl-familly.txt|   47 +
 Documentation/devicetree/bindings/rtc/twl-rtc.txt  |   12 +++
 arch/arm/boot/dts/omap3-beagle.dts |   29 ++
 arch/arm/boot/dts/omap3.dtsi   |   21 
 arch/arm/boot/dts/omap4-panda.dts  |   34 +++
 arch/arm/boot/dts/omap4-sdp.dts|   53 ++
 arch/arm/boot/dts/omap4.dtsi   |   28 ++
 arch/arm/boot/dts/twl4030.dtsi |   21 
 arch/arm/boot/dts/twl6030.dtsi |   22 
 arch/arm/mach-omap2/board-generic.c|   48 +-
 arch/arm/mach-omap2/pm.c   |8 ++
 drivers/i2c/busses/i2c-omap.c  |  102 +---
 drivers/mfd/Kconfig|1 +
 drivers/mfd/twl-core.c |   51 ++-
 drivers/rtc/rtc-twl.c  |   10 ++-
 16 files changed, 433 insertions(+), 84 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/twl-familly.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/twl-rtc.txt
 create mode 100644 arch/arm/boot/dts/twl4030.dtsi
 create mode 100644 arch/arm/boot/dts/twl6030.dtsi

--
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 v4 01/12] ARM: OMAP2+: pm: Do not init statically the SR and voltage layer with DT

2011-12-22 Thread Benoit Cousson
In the case of DT, the PMIC and SR initialization will be done using
a completely different mechanism.

Disable this part if a DT blob is available.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Acked-by: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/pm.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 1881fe9..ad4f693 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -227,6 +227,14 @@ postcore_initcall(omap2_common_pm_init);
 
 static int __init omap2_common_pm_late_init(void)
 {
+   /*
+* In the case of DT, the PMIC and SR initialization will be done using
+* a completely different mechanism.
+* Disable this part if a DT blob is available.
+*/
+   if (of_have_populated_dt())
+   return 0;
+
/* Init the voltage layer */
omap_pmic_late_init();
omap_voltage_late_init();
-- 
1.7.0.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


[PATCH v4 03/12] mfd: twl-core: Add initial DT support for twl4030/twl6030

2011-12-22 Thread Benoit Cousson
Add initial device-tree support for twl familly chips.
The current version is missing the regulator entries due
to the lack of DT regulator bindings for the moment.
Only the simple sub-modules that do not depend on
platform_data information can be initialized properly.

Add irqdomain support.

Add documentation for the Texas Instruments TWL Integrated Chip.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Balaji T K balaj...@ti.com
Cc: Graeme Gregory g...@slimlogic.co.uk
Cc: Samuel Ortiz sa...@linux.intel.com
---
 .../devicetree/bindings/mfd/twl-familly.txt|   47 ++
 drivers/mfd/Kconfig|1 +
 drivers/mfd/twl-core.c |   51 +++-
 3 files changed, 98 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/twl-familly.txt

diff --git a/Documentation/devicetree/bindings/mfd/twl-familly.txt 
b/Documentation/devicetree/bindings/mfd/twl-familly.txt
new file mode 100644
index 000..ff4cacd
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/twl-familly.txt
@@ -0,0 +1,47 @@
+Texas Instruments TWL family
+
+The TWLs are Integrated Power Management Chips.
+Some version might contain much more analog function like
+USB transceiver or Audio amplifier.
+These chips are connected to an i2c bus.
+
+
+Required properties:
+- compatible : Must be ti,twl4030;
+  For Integrated power-management/audio CODEC device used in OMAP3
+  based boards
+- compatible : Must be ti,twl6030;
+  For Integrated power-management used in OMAP4 based boards
+- interrupts : This i2c device has an IRQ line connected to the main SoC
+- interrupt-controller : Since the twl support several interrupts internally,
+  it is considered as an interrupt controller cascaded to the SoC one.
+- #interrupt-cells = 1;
+- interrupt-parent : The parent interrupt controller.
+
+Optional node:
+- Child nodes contain in the twl. The twl family is made of severals variants
+  that support a different number of features.
+  The children nodes will thus depend of the capabilty of the variant.
+
+
+Example:
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/twl6030.pdf
+ */
+twl@48 {
+compatible = ti,twl6030;
+reg = 0x48;
+interrupts = 39; /* IRQ_SYS_1N cascaded to gic */
+interrupt-controller;
+#interrupt-cells = 1;
+interrupt-parent = gic;
+#address-cells = 1;
+#size-cells = 0;
+
+twl_rtc {
+compatible = ti,twl_rtc;
+interrupts = 11;
+reg = 0;
+};
+};
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index f1391c2..f0de088 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -200,6 +200,7 @@ config MENELAUS
 config TWL4030_CORE
bool Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support
depends on I2C=y  GENERIC_HARDIRQS
+   select IRQ_DOMAIN
help
  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
  This core driver provides register access and IRQ handling
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index bfbd660..698bf0d 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -34,6 +34,11 @@
 #include linux/platform_device.h
 #include linux/clk.h
 #include linux/err.h
+#include linux/device.h
+#include linux/of.h
+#include linux/of_irq.h
+#include linux/of_platform.h
+#include linux/irqdomain.h
 
 #include linux/regulator/machine.h
 
@@ -144,6 +149,9 @@
 
 #define TWL_MODULE_LAST TWL4030_MODULE_LAST
 
+#define TWL4030_NR_IRQS8
+#define TWL6030_NR_IRQS20
+
 /* Base Address defns for twl4030_map[] */
 
 /* subchip/slave 0 - USB ID */
@@ -255,6 +263,7 @@ struct twl_client {
 
 static struct twl_client twl_modules[TWL_NUM_SLAVES];
 
+static struct irq_domain domain;
 
 /* mapping the module id to slave id and base address */
 struct twl_mapping {
@@ -1183,14 +1192,48 @@ twl_probe(struct i2c_client *client, const struct 
i2c_device_id *id)
int status;
unsignedi;
struct twl4030_platform_data*pdata = client-dev.platform_data;
+   struct device_node  *node = client-dev.of_node;
u8 temp;
int ret = 0;
+   int nr_irqs = TWL4030_NR_IRQS;
+
+   if ((id-driver_data)  TWL6030_CLASS)
+   nr_irqs = TWL6030_NR_IRQS;
+
+   if (node  !pdata) {
+   /*
+* XXX: Temporary pdata until the information is correctly
+* retrieved by every TWL modules from DT.
+*/
+   pdata = devm_kzalloc(client-dev,
+sizeof(struct twl4030_platform_data),
+GFP_KERNEL);
+   if (!pdata)
+   return -ENOMEM;
+   }
 
if (!pdata) {
dev_dbg(client-dev, no platform data?\n);
return -EINVAL;
}
 
+   status = 

[PATCH v4 05/12] arm/dts: OMAP4: Add i2c controller nodes

2011-12-22 Thread Benoit Cousson
Add i2c controllers nodes into the main ocp bus.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
---
 arch/arm/boot/dts/omap4.dtsi |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index bede009..9872283 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -100,5 +100,33 @@
reg = 0x48241000 0x1000,
  0x48240100 0x0100;
};
+
+   i2c1: i2c@1 {
+   compatible = ti,omap4-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c1;
+   };
+
+   i2c2: i2c@2 {
+   compatible = ti,omap4-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c2;
+   };
+
+   i2c3: i2c@3 {
+   compatible = ti,omap4-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c3;
+   };
+
+   i2c4: i2c@4 {
+   compatible = ti,omap4-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c4;
+   };
};
 };
-- 
1.7.0.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


[PATCH v4 02/12] i2c: OMAP: Add DT support for i2c controller

2011-12-22 Thread Benoit Cousson
Add initial DT support to retrieve the frequency using a
DT attribute instead of the pdata pointer if of_node exist.

Add documentation for omap i2c controller binding.

Based on original patches from Manju and Grant.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Ben Dooks ben-li...@fluff.org
Cc: Kevin Hilman khil...@ti.com
Reviewed-by: Rob Herring rob.herr...@calxeda.com
---
 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   30 ++
 drivers/i2c/busses/i2c-omap.c  |  102 +---
 2 files changed, 97 insertions(+), 35 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt

diff --git a/Documentation/devicetree/bindings/i2c/omap-i2c.txt 
b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
new file mode 100644
index 000..56564aa
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
@@ -0,0 +1,30 @@
+I2C for OMAP platforms
+
+Required properties :
+- compatible : Must be ti,omap3-i2c or ti,omap4-i2c
+- ti,hwmods : Must be i2cn, n being the instance number (1-based)
+- #address-cells = 1;
+- #size-cells = 0;
+
+Recommended properties :
+- clock-frequency : Desired I2C bus clock frequency in Hz. Otherwise
+  the default 100 kHz frequency will be used.
+
+Optional properties:
+- Child nodes conforming to i2c bus binding
+
+Note: Current implementation will fetch base address, irq and dma
+from omap hwmod data base during device registration.
+Future plan is to migrate hwmod data base contents into device tree
+blob so that, all the required data will be used from device tree dts
+file.
+
+Examples :
+
+i2c1: i2c@0 {
+compatible = ti,omap3-i2c;
+#address-cells = 1;
+#size-cells = 0;
+ti,hwmods = i2c1;
+clock-frequency = 40;
+};
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index a43d002..b03b3e3 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -37,6 +37,9 @@
 #include linux/platform_device.h
 #include linux/clk.h
 #include linux/io.h
+#include linux/of.h
+#include linux/of_i2c.h
+#include linux/of_device.h
 #include linux/slab.h
 #include linux/i2c-omap.h
 #include linux/pm_runtime.h
@@ -182,7 +185,9 @@ struct omap_i2c_dev {
u32 latency;/* maximum mpu wkup latency */
void(*set_mpu_wkup_lat)(struct device *dev,
long latency);
-   u32 speed;  /* Speed of bus in Khz */
+   u32 speed;  /* Speed of bus in kHz */
+   u32 dtrev;  /* extra revision from DT */
+   u32 flags;
u16 cmd_err;
u8  *buf;
u8  *regs;
@@ -266,11 +271,7 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev 
*i2c_dev, int reg)
 
 static void omap_i2c_unidle(struct omap_i2c_dev *dev)
 {
-   struct omap_i2c_bus_platform_data *pdata;
-
-   pdata = dev-dev-platform_data;
-
-   if (pdata-flags  OMAP_I2C_FLAG_RESET_REGS_POSTIDLE) {
+   if (dev-flags  OMAP_I2C_FLAG_RESET_REGS_POSTIDLE) {
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
omap_i2c_write_reg(dev, OMAP_I2C_PSC_REG, dev-pscstate);
omap_i2c_write_reg(dev, OMAP_I2C_SCLL_REG, dev-scllstate);
@@ -291,13 +292,10 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
 
 static void omap_i2c_idle(struct omap_i2c_dev *dev)
 {
-   struct omap_i2c_bus_platform_data *pdata;
u16 iv;
 
-   pdata = dev-dev-platform_data;
-
dev-iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
-   if (pdata-rev == OMAP_I2C_IP_VERSION_2)
+   if (dev-dtrev == OMAP_I2C_IP_VERSION_2)
omap_i2c_write_reg(dev, OMAP_I2C_IP_V2_IRQENABLE_CLR, 1);
else
omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
@@ -320,9 +318,6 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
unsigned long timeout;
unsigned long internal_clk = 0;
struct clk *fclk;
-   struct omap_i2c_bus_platform_data *pdata;
-
-   pdata = dev-dev-platform_data;
 
if (dev-rev = OMAP_I2C_OMAP1_REV_2) {
/* Disable I2C controller before soft reset */
@@ -373,7 +368,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
}
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
 
-   if (pdata-flags  OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK) {
+   if (dev-flags  OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK) {
/*
 * The I2C functional clock is the armxor_ck, so there's
 * no need to get armxor_ck separately.  Now, if OMAP2420
@@ -397,7 +392,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
psc = fclk_rate / 1200;
}
 
-   if (!(pdata-flags  OMAP_I2C_FLAG_SIMPLE_CLOCK)) {
+   if (!(dev-flags  

[PATCH v4 06/12] arm/dts: OMAP3: Add i2c controller nodes

2011-12-22 Thread Benoit Cousson
Add i2c controllers nodes into the main ocp bus.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
---
 arch/arm/boot/dts/omap3.dtsi |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 6866dc7..697b210 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -61,5 +61,26 @@
ti,intc-size = 96;
reg = 0x4820 0x1000;
};
+
+   i2c1: i2c@1 {
+   compatible = ti,omap3-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c1;
+   };
+
+   i2c2: i2c@2 {
+   compatible = ti,omap3-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c2;
+   };
+
+   i2c3: i2c@3 {
+   compatible = ti,omap3-i2c;
+   #address-cells = 1;
+   #size-cells = 0;
+   ti,hwmods = i2c3;
+   };
};
 };
-- 
1.7.0.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


[PATCH v4 07/12] arm/dts: twl6030: Add DTS file for twl6030 PMIC

2011-12-22 Thread Benoit Cousson
Add a dedicated DTS file for the twl6030 Power IC.
This chip is a big SoC that will be reused in a lot of various
OMAP4+ boards.

Note: This file is supposed to be included in a board DTS that will
create the twl node in order to allow the twl reference to work.

Exmaple:
...
i2c1 {
twl: twl@48 {
reg = 0x48;
interrupts = 0 7 4;
interrupt-controller;
interrupt-parent = gic;
};
};

/include/ twl6030.dtsi
...

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
---
 arch/arm/boot/dts/twl6030.dtsi |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/twl6030.dtsi

diff --git a/arch/arm/boot/dts/twl6030.dtsi b/arch/arm/boot/dts/twl6030.dtsi
new file mode 100644
index 000..b7b4e5e
--- /dev/null
+++ b/arch/arm/boot/dts/twl6030.dtsi
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.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.
+ */
+
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/twl6030.pdf
+ */
+twl {
+   compatible = ti,twl6030;
+   interrupt-controller;
+   #interrupt-cells = 1;
+
+   rtc {
+   compatible = ti,twl4030-rtc;
+   interrupts = 11;
+   };
+};
-- 
1.7.0.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


[PATCH v4 09/12] arm/dts: omap4-panda: Add twl6030 and i2c EEPROM

2011-12-22 Thread Benoit Cousson
Update pandaboard dts file with required clock frequencies
for the i2c client devices existing on pandaboard.

Add the twl6030 node in i2c1 controller.

This is the minimal support needed to boot OMAP4 boards
without any crash.
The support for all the features included in this MFD will be
added later.

Add a generic i2c EEPROM entry.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
---
 arch/arm/boot/dts/omap4-panda.dts |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index 9755ad5..29646dc 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -18,3 +18,37 @@
reg = 0x8000 0x4000; /* 1 GB */
};
 };
+
+i2c1 {
+   clock-frequency = 40;
+
+   twl: twl@48 {
+   reg = 0x48;
+   /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
+   interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */
+   interrupt-parent = gic;
+   };
+};
+
+/include/ twl6030.dtsi
+
+i2c2 {
+   clock-frequency = 40;
+};
+
+i2c3 {
+   clock-frequency = 10;
+
+   /*
+* Display monitor features are burnt in their EEPROM as EDID data.
+* The EEPROM is connected as I2C slave device.
+*/
+   eeprom@50 {
+   compatible = ti,eeprom;
+   reg = 0x50;
+   };
+};
+
+i2c4 {
+   clock-frequency = 40;
+};
-- 
1.7.0.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


[PATCH v4 11/12] arm/dts: omap3-beagle: Add twl4030 and i2c EEPROM

2011-12-22 Thread Benoit Cousson
Add required clock frequencies for the i2c client devices existing
on beagle board.

Add the twl4030 basic description with only the twl_rtc module.

Add the EEPROM node.

Based on original patch from Manju:
http://www.spinics.net/lists/linux-omap/msg55831.html

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
---
 arch/arm/boot/dts/omap3-beagle.dts |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-beagle.dts 
b/arch/arm/boot/dts/omap3-beagle.dts
index 9f72cd4..714ba5d 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -18,3 +18,32 @@
reg = 0x8000 0x2000; /* 512 MB */
};
 };
+
+i2c1 {
+   clock-frequency = 260;
+
+   twl: twl@48 {
+   reg = 0x48;
+   interrupts = 7; /* SYS_NIRQ cascaded to intc */
+   interrupt-parent = intc;
+   };
+};
+
+/include/ twl4030.dtsi
+
+i2c2 {
+   clock-frequency = 40;
+};
+
+i2c3 {
+   clock-frequency = 10;
+
+   /*
+* Display monitor features are burnt in the EEPROM
+* as EDID data.
+*/
+   eeprom@50 {
+   compatible = ti,eeprom;
+   reg = 0x50;
+   };
+};
-- 
1.7.0.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


[PATCH v4 12/12] ARM: OMAP2+: board-generic: Remove i2c static init

2011-12-22 Thread Benoit Cousson
This mainly reverts the commit that was adding the i2c static init.

Since the i2c and twl nodes are now present, there is no need
for the static initialization anymore.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-generic.c |   48 +-
 1 files changed, 2 insertions(+), 46 deletions(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 2529017..38f105d 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -15,7 +15,6 @@
 #include linux/of_irq.h
 #include linux/of_platform.h
 #include linux/irqdomain.h
-#include linux/i2c/twl.h
 
 #include mach/hardware.h
 #include asm/hardware/gic.h
@@ -36,34 +35,6 @@ static void __init omap_init_irq(void)
of_irq_init(irq_match);
 }
 
-/*
- * XXX: Still needed to boot until the i2c  twl driver is adapted to
- * device-tree
- */
-#ifdef CONFIG_ARCH_OMAP4
-static struct twl4030_platform_data sdp4430_twldata = {
-   .irq_base   = TWL6030_IRQ_BASE,
-   .irq_end= TWL6030_IRQ_END,
-};
-
-static void __init omap4_i2c_init(void)
-{
-   omap4_pmic_init(twl6030, sdp4430_twldata);
-}
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct twl4030_platform_data beagle_twldata = {
-   .irq_base   = TWL4030_IRQ_BASE,
-   .irq_end= TWL4030_IRQ_END,
-};
-
-static void __init omap3_i2c_init(void)
-{
-   omap3_pmic_init(twl4030, beagle_twldata);
-}
-#endif
-
 static struct of_device_id omap_dt_match_table[] __initdata = {
{ .compatible = simple-bus, },
{ .compatible = ti,omap-infra, },
@@ -78,21 +49,6 @@ static void __init omap_generic_init(void)
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
 }
 
-#ifdef CONFIG_ARCH_OMAP4
-static void __init omap4_init(void)
-{
-   omap4_i2c_init();
-   omap_generic_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static void __init omap3_init(void)
-{
-   omap3_i2c_init();
-   omap_generic_init();
-}
-#endif
 
 #if defined(CONFIG_SOC_OMAP2420)
 static const char *omap242x_boards_compat[] __initdata = {
@@ -145,7 +101,7 @@ DT_MACHINE_START(OMAP3_DT, Generic OMAP3 (Flattened Device 
Tree))
.init_early = omap3430_init_early,
.init_irq   = omap_init_irq,
.handle_irq = omap3_intc_handle_irq,
-   .init_machine   = omap3_init,
+   .init_machine   = omap_generic_init,
.timer  = omap3_timer,
.dt_compat  = omap3_boards_compat,
 MACHINE_END
@@ -164,7 +120,7 @@ DT_MACHINE_START(OMAP4_DT, Generic OMAP4 (Flattened Device 
Tree))
.init_early = omap4430_init_early,
.init_irq   = omap_init_irq,
.handle_irq = gic_handle_irq,
-   .init_machine   = omap4_init,
+   .init_machine   = omap_generic_init,
.timer  = omap4_timer,
.dt_compat  = omap4_boards_compat,
 MACHINE_END
-- 
1.7.0.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


[PATCH v4 10/12] arm/dts: omap4-sdp: Add twl6030, i2c3 and i2c4 devices

2011-12-22 Thread Benoit Cousson
Update DTS file with required clock frequencies
for the i2c client devices existing on sdp4430.

Add the twl6030 node inside the i2c1 controller node.
This is the minimal support needed to boot OMAP4 boards
without any crash.
The support for all the features included in this MFD will be
added later.

Add the RTC submodule inside the twl node.

Add tmp105 temperature sensor in i2c3
Add bh1780 Ambient Light Sensor in i2c3
Add hmc5843 3-Axis Digital Compass in i2c4

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
---
 arch/arm/boot/dts/omap4-sdp.dts |   53 +++
 1 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 63c6b2b..17e829a 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -18,3 +18,56 @@
reg = 0x8000 0x4000; /* 1 GB */
};
 };
+
+i2c1 {
+   clock-frequency = 40;
+
+   twl: twl@48 {
+   reg = 0x48;
+   /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
+   interrupts = 0 7 4; /* IRQ_SYS_1N cascaded to gic */
+   interrupt-parent = gic;
+   };
+};
+
+/include/ twl6030.dtsi
+
+i2c2 {
+   clock-frequency = 40;
+   reg = 0x48072000 0x100, 0x48072100 0x100, 0x48072200 0x100;
+};
+
+i2c3 {
+   clock-frequency = 40;
+
+   /*
+* Temperature Sensor
+* http://www.ti.com/lit/ds/symlink/tmp105.pdf
+*/
+   tmp105@48 {
+   compatible = ti,tmp105;
+   reg = 0x48;
+   };
+
+   /*
+* Ambient Light Sensor
+* http://www.rohm.com/products/databook/sensor/pdf/bh1780gli-e.pdf
+*/
+   bh1780@29 {
+   compatible = rohm,bh1780;
+   reg = 0x29;
+   };
+};
+
+i2c4 {
+   clock-frequency = 40;
+
+   /*
+* 3-Axis Digital Compass
+* http://www.sparkfun.com/datasheets/Sensors/Magneto/HMC5843.pdf
+*/
+   hmc5843@1e {
+   compatible = honeywell,hmc5843;
+   reg = 0x1e;
+   };
+};
-- 
1.7.0.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


[PATCH v4 08/12] arm/dts: twl4030: Add DTS file for twl4030 PM + Audio IC

2011-12-22 Thread Benoit Cousson
Add a dedicated DTS file for the twl4030/5030 Power + Audio IC.
This chip is a big SoC that will be reused in a lot of various
OMAP3 boards.

Signed-off-by: Benoit Cousson b-cous...@ti.com
Cc: Grant Likely grant.lik...@secretlab.ca
Cc: Rob Herring rob.herr...@calxeda.com
---
 arch/arm/boot/dts/twl4030.dtsi |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/twl4030.dtsi

diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
new file mode 100644
index 000..8be5223
--- /dev/null
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.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.
+ */
+
+/*
+ * Integrated Power Management Chip
+ */
+twl {
+   compatible = ti,twl4030;
+   interrupt-controller;
+   #interrupt-cells = 1;
+
+   rtc {
+   compatible = ti,twl4030-rtc;
+   interrupts = 11;
+   };
+};
-- 
1.7.0.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: [PATCH v3 00/11] OMAP4: Add DT support for i2c and twl6030

2011-12-22 Thread Rob Herring
On 12/20/2011 10:27 AM, Benoit Cousson wrote:
 Hi Tony and Rob,
 
 Here is the updated version of the i2c + twl DT adaptation series.
 
 This update, compared to v2 [1], is adding some dedicated dtsi files for
 the twl PMIC and audio IC. These devices will contain a huge amount of
 regulator nodes and thus deserve a dedicated file to avoid every boards
 to redefine the same data.
 The twl patch is now included in Samuel's for-next branch and thus dropped
 from this update.
 The i2c binding was cleaned as suggested by Rob to avoid all the ugly
 hexa flags inside the DTS.
 
 The pm.c was updated to prevent the SR / VP initialization in the DT
 context since none of them is DT aware for the moment.
 
 A couple of basic i2c devices are added for panda, beagle and sdp board.
 
 Patches are based on for_3.3/2_dt_irq, to get the latest GIC binding,
 and are available here:
 git://gitorious.org/omap-pm/linux.git for_3.3/3_omap_dt_i2c_twl
 
 Tested on Beagle and sdp4430.
 
 Comments are welcome.
 
 Regards,
 Benoit
 
 [1] http://www.spinics.net/lists/linux-omap/msg61260.html
 
 
 Benoit Cousson (11):
   ARM: OMAP2+: pm: Do not init statically the SR and voltage layer with DT
   i2c: OMAP: Add DT support for i2c controller
   rtc: rtc-twl: Add DT support for RTC inside twl4030/twl6030
   arm/dts: OMAP4: Add i2c controller nodes
   arm/dts: OMAP3: Add i2c controller nodes
   arm/dts: twl6030: Add DTS file for twl6030 PMIC
   arm/dts: twl4030: Add DTS file for twl4030 PM + Audio IC
   arm/dts: omap4-panda: Add twl6030 and i2c EEPROM
   arm/dts: omap4-sdp: Add twl6030, i2c3 and i2c4 devices
   arm/dts: omap3-beagle: Add twl4030 and i2c EEPROM
   ARM: OMAP2+: board-generic: Remove i2c static init
 
  Documentation/devicetree/bindings/i2c/omap-i2c.txt |   30 ++
  Documentation/devicetree/bindings/rtc/twl-rtc.txt  |   12 +++
  arch/arm/boot/dts/omap3-beagle.dts |   29 ++
  arch/arm/boot/dts/omap3.dtsi   |   21 
  arch/arm/boot/dts/omap4-panda.dts  |   34 +++
  arch/arm/boot/dts/omap4-sdp.dts|   53 ++
  arch/arm/boot/dts/omap4.dtsi   |   28 ++
  arch/arm/boot/dts/twl4030.dtsi |   21 
  arch/arm/boot/dts/twl6030.dtsi |   22 
  arch/arm/mach-omap2/board-generic.c|   48 +-
  arch/arm/mach-omap2/pm.c   |8 ++
  drivers/i2c/busses/i2c-omap.c  |  101 
 +---
  drivers/rtc/rtc-twl.c  |   10 ++-
  13 files changed, 334 insertions(+), 83 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt
  create mode 100644 Documentation/devicetree/bindings/rtc/twl-rtc.txt
  create mode 100644 arch/arm/boot/dts/twl4030.dtsi
  create mode 100644 arch/arm/boot/dts/twl6030.dtsi

For the series:

Acked-by: Rob Herring rob.herr...@calxeda.com
--
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] OMAP3: hwmod_data: register dss hwmods after dss_core

2011-12-22 Thread Igor Grinberg
Hi Ilya,

Thanks for the patch.

On 12/22/11 16:02, Ilya Yanok wrote:
 dss_core has to be initialized before any other DSS hwmod. Currently
 this is broken as dss_core is listed in chip/revision specific hwmod
 lists while other DSS hwmods are listed in common list which is
 registered first.
 
 This patch moves DSS hwmods (except for dss_core) to the separate list
 which is registered last to ensure that dss_core is already registered.

I would suggest to add an in-code comment for this
(more descriptive, than the one you did for that patch),
and describe the otherwise breakage, so next time it would be
a bit harder to break that thing...

 
 CC: Tomi Valkeinen tomi.valkei...@ti.com
 CC: Archit Taneja arc...@ti.com
 CC: Paul Walmsley p...@pwsan.com
 Signed-off-by: Ilya Yanok ya...@emcraft.com
 ---
  arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   20 ++--
  1 files changed, 14 insertions(+), 6 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
 b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
 index 5324e8d..85536ff 100644
 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
 +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
 @@ -3523,12 +3523,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] 
 = {
   omap3xxx_uart2_hwmod,
   omap3xxx_uart3_hwmod,
  
 - /* dss class */
 - omap3xxx_dss_dispc_hwmod,
 - omap3xxx_dss_dsi1_hwmod,
 - omap3xxx_dss_rfbi_hwmod,
 - omap3xxx_dss_venc_hwmod,
 -
   /* i2c class */
   omap3xxx_i2c1_hwmod,
   omap3xxx_i2c2_hwmod,
 @@ -3635,6 +3629,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = 
 {
   NULL
  };
  
 +static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
 + /* dss class */
 + omap3xxx_dss_dispc_hwmod,
 + omap3xxx_dss_dsi1_hwmod,
 + omap3xxx_dss_rfbi_hwmod,
 + omap3xxx_dss_venc_hwmod,
 + NULL
 +};
 +
  int __init omap3xxx_hwmod_init(void)
  {
   int r;
 @@ -3708,6 +3711,11 @@ int __init omap3xxx_hwmod_init(void)
  
   if (h)
   r = omap_hwmod_register(h);
 + if (r  0)
 + return r;
 +
 + /* Register common DSS hwmods later than dss_core */
 + r = omap_hwmod_register(omap3xxx_dss_hwmods);
  
   return r;
  }

-- 
Regards,
Igor.
--
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: Adding remoteproc/rpmsg to linux-next

2011-12-22 Thread Arnd Bergmann
On Wednesday 21 December 2011, Ohad Ben-Cohen wrote:
 Hi Arnd,
 
 On Mon, Dec 12, 2011 at 1:33 AM, Stephen Rothwell s...@canb.auug.org.au 
 wrote:
  On Fri, 9 Dec 2011 16:55:27 +0200 Ohad Ben-Cohen o...@wizery.com wrote:
 
  Can you please add the following remoteproc tree to linux-next ?
 
  git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git for-next
 
  I have added that from today.
 
 Would you like rpmsg/remoteproc to go through arm-soc or do you prefer
 me to send a pull request directly to Linus ?
 
 If you prefer the former (IIRC you told me you might consider it in a
 random ELCE hallway conversation :) then I'll send you a pull request.
 
 I'm happy either way.

Either way works for me, too. Right now, I would tend to let you send it
to Linus directly because I haven't looked at the latest versions of the
code for some time. While I generally trust you to do the right thing
there, I'm not 100% comfortable to vouch for it in the way that an Ack
or pull would imply without doing a more detailed review of the latest
code.

I know that I promised you that review, but haven't gotten to it, sorry.
I've done a 5 minute review now and it absolutely looks good to go in
as far as I can tell, so I certainly don't object to you sending it
to Linus for 3.3. If you think you need more Acks or if there are other
reasons to have it go through arm-soc, please tell me and I'll try harder
to find the time for a proper review.

Arnd
--
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/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Liam Girdwood
On Thu, 2011-12-22 at 13:04 +, Mark Brown wrote:
 On Thu, Dec 22, 2011 at 02:42:40PM +0200, Peter Ujfalusi wrote:
 
   include/linux/platform_data/omap-abe-twl6040.h |   48 
  
 
 omap-abe-mcpdm-twl6040 please.  Seriously, just drop the abe - it's not
 an optional feature of the OMAP and the names are getting quite long.

ABE can be an optional feature on OMAP (and quite an important one when
it is used). Fwiw, we do have a mixture of users, most use the ABE but
some don't, so it's best to specify ABE in the naming to avoid any
confusion.

This patch looks fine to me.

Regards

Liam


--
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 2/2] OMAP4: mcbsp: Clock reparenting support

2011-12-22 Thread Peter Ujfalusi
Hi Paul,

On 12/17/2011 02:37 AM, Paul Walmsley wrote:
 What do you think about using clkdev alias lines and hwmod optional clks 
 for this instead?  With these mechanisms, you can give clocks a consistent 
 role name for a given device, even if the underlying clock changes on 
 different platforms.

I need to look into the clock framework, but sounds promising.
I can see quite big difference between the clock3xxx_data, and
clock44xx_data regarding to McBSPs.
Need to understand why, and what need to be changed to achieve what I want.

 So in the mach-omap2/clock*_data.c files, you'd do something like
 
   CLK(omap-mcbsp.1, pad_fck,  mcbsp_clks,  CK_3XXX),
 
 for OMAP3, and 
 
   CLK(omap-mcbsp.1, pad_fck,  pad_clks_clk,  CK_44XX),
 
 for OMAP4.
 
 Then in the hwmod data files, you'd add them as optional clocks - 
 something like:
 
 static struct omap_hwmod_opt_clk mcbsp1_opt_clks[] = {
   { .role = pad_fck, .clk = mcbsp_clks },
 };
 
 for OMAP3, and
 
 static struct omap_hwmod_opt_clk mcbsp1_opt_clks[] = {
   { .role = pad_fck, .clk = pad_clks_clk },
 };
 
 for OMAP4.
 
 I think this might work for your needs?

Is it OK if I do this as an incremental patch as soon as I figured out
the way to do it nicely?

Thank you,
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


[PATCH v2 0/9] OMAP4: ASoC: Support for PandaBoard family

2011-12-22 Thread Peter Ujfalusi
Hello,

the following series will add ASoC support for PandaBoards.
PandaBoards have different audio routings compared to SDP4430/Blaze boards, but
the differences not that big to justify a new ASoC machine driver.

This series is based on the first three patch from the v1 sereis (those, which
has been applied by Liam).

Changes since v1:
As suggested by Mark the platform data, machine driver has been converted to
process feature flags instead of Board IDs.
- The ASoC machine driver registers all DAPM widgets. Based on the received
  configuration it will disable the unused paths
- PCM for dmic is only created, if the board has digital mic conencted
- Jack functionality will be only used on boards supporting it
- Sound card name for SDP4430 has net been changed

Regards,
Peter
---
Peter Ujfalusi (9):
  include: platform_data: Platform data header for OMAP4 ASoC audio
  OMAP4: 4430sdp: Register platform device for OMAP4 audio
  ASoC: omap-abe-twl6040: Convert to platform deriver
  ASoC: twl6040: Convert MICBIAS to SUPPLY widget
  ASoC: omap-abe-twl6040: Add complete DAPM routing
  ASoC: omap-abe-twl6040: DAI link selection based on platform data
  ASoC: omap-abe-twl6040: Configure card according to platform data
  OMAP4: omap4panda: Enable audio support
  ASoC: Kconfig: OMAP4: Enable support for PandaBoards

 arch/arm/mach-omap2/board-4430sdp.c|   27 
 arch/arm/mach-omap2/board-omap4panda.c |   56 -
 include/linux/platform_data/omap-abe-twl6040.h |   48 +++
 sound/soc/codecs/twl6040.c |   16 +-
 sound/soc/omap/Kconfig |5 +-
 sound/soc/omap/omap-abe-twl6040.c  |  178 
 6 files changed, 260 insertions(+), 70 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

-- 
1.7.8.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 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Peter Ujfalusi
Include file to be used with the upcoming ASoC machine driver
for OMAP platform using ABE with twl6040 codec.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 include/linux/platform_data/omap-abe-twl6040.h |   48 
 1 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

diff --git a/include/linux/platform_data/omap-abe-twl6040.h 
b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644
index 000..286f644
--- /dev/null
+++ b/include/linux/platform_data/omap-abe-twl6040.h
@@ -0,0 +1,48 @@
+/**
+ * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Author: Peter Ujfalusi peter.ujfal...@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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _OMAP_ABE_TWL6040_H_
+#define _OMAP_ABE_TWL6040_H_
+
+/* To select if only one channel is connected in a stereo port */
+#define ABE_TWL6040_LEFT   (1  0)
+#define ABE_TWL6040_RIGHT  (1  1)
+
+struct omap_abe_twl6040_data {
+   char *card_name;
+   /* Feature flags for connected audio pins */
+   u8  has_hs;
+   u8  has_hf;
+   boolhas_ep;
+   u8  has_aux;
+   u8  has_vibra;
+   boolhas_dmic;
+   boolhas_hsmic;
+   boolhas_mainmic;
+   boolhas_submic;
+   u8  has_afm;
+   /* Other features */
+   booljack_detection; /* board can detect jack events */
+};
+
+#endif /* _OMAP_ABE_TWL6040_H_ */
-- 
1.7.8.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 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio

2011-12-22 Thread Peter Ujfalusi
To avoid breakage in audio support with the coming change
in ASoC machine driver (conversion to platfrom device).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 21b62bd..394cbab 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -41,6 +41,7 @@
 #include video/omap-panel-nokia-dsi.h
 #include video/omap-panel-picodlp.h
 #include linux/wl12xx.h
+#include linux/platform_data/omap-abe-twl6040.h
 
 #include mux.h
 #include hsmmc.h
@@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
.id = -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+   .card_name = SDP4430,
+   .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_ep = 1,
+   .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_vibra  = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+   .has_dmic   = 1,
+   .has_hsmic  = 1,
+   .has_mainmic= 1,
+   .has_submic = 1,
+   .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+   .jack_detection = 1,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+   .name   = omap-abe-twl6040,
+   .id = -1,
+   .dev = {
+   .platform_data = sdp4430_abe_audio_data,
+   },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_gpio_keys_device,
sdp4430_leds_gpio,
sdp4430_leds_pwm,
sdp4430_vbat,
sdp4430_dmic_codec,
+   sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.8.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 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Peter Ujfalusi
In order to avoid breakage change the omap-abe-twl6040
machine driver's routing.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c|   16 
 sound/soc/omap/omap-abe-twl6040.c |   14 +++---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a4a65dc..2be98e8 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1102,14 +1102,14 @@ static const struct snd_soc_dapm_widget 
twl6040_dapm_widgets[] = {
TWL6040_REG_MICRCTL, 2, 0),
 
/* Microphone bias */
-   SND_SOC_DAPM_MICBIAS(Headset Mic Bias,
-   TWL6040_REG_AMICBCTL, 0, 0),
-   SND_SOC_DAPM_MICBIAS(Main Mic Bias,
-   TWL6040_REG_AMICBCTL, 4, 0),
-   SND_SOC_DAPM_MICBIAS(Digital Mic1 Bias,
-   TWL6040_REG_DMICBCTL, 0, 0),
-   SND_SOC_DAPM_MICBIAS(Digital Mic2 Bias,
-   TWL6040_REG_DMICBCTL, 4, 0),
+   SND_SOC_DAPM_SUPPLY(Headset Mic Bias,
+   TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Main Mic Bias,
+   TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Digital Mic1 Bias,
+   TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Digital Mic2 Bias,
+   TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
 
/* DACs */
SND_SOC_DAPM_DAC(HSDAC Left, Headset Playback, SND_SOC_NOPM, 0, 0),
diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 4974ea1..18a25b0 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -123,17 +123,17 @@ static const struct snd_soc_dapm_widget 
twl6040_dapm_widgets[] = {
 
 static const struct snd_soc_dapm_route audio_map[] = {
/* External Mics: MAINMIC, SUBMIC with bias*/
-   {MAINMIC, NULL, Main Mic Bias},
-   {SUBMIC, NULL, Main Mic Bias},
-   {Main Mic Bias, NULL, Ext Mic},
+   {MAINMIC, NULL, Ext Mic},
+   {SUBMIC, NULL, Ext Mic},
+   {Ext Mic, NULL, Main Mic Bias},
 
/* External Speakers: HFL, HFR */
{Ext Spk, NULL, HFL},
{Ext Spk, NULL, HFR},
 
/* Headset Mic: HSMIC with bias */
-   {HSMIC, NULL, Headset Mic Bias},
-   {Headset Mic Bias, NULL, Headset Mic},
+   {HSMIC, NULL, Headset Mic},
+   {Headset Mic, NULL, Headset Mic Bias},
 
/* Headset Stereophone (Headphone): HSOL, HSOR */
{Headset Stereophone, NULL, HSOL},
@@ -182,8 +182,8 @@ static const struct snd_soc_dapm_widget dmic_dapm_widgets[] 
= {
 };
 
 static const struct snd_soc_dapm_route dmic_audio_map[] = {
-   {DMic, NULL, Digital Mic1 Bias},
-   {Digital Mic1 Bias, NULL, Digital Mic},
+   {DMic, NULL, Digital Mic},
+   {Digital Mic, NULL, Digital Mic1 Bias},
 };
 
 static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.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 7/9] ASoC: omap-abe-twl6040: Configure card according to platform data

2011-12-22 Thread Peter Ujfalusi
Disable the not connected pins on the board based on the
received platform data.
DO not register the jack function on boards, which does not have
means to detect it (jack is always connected).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   41 ++--
 1 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 9e6e4c2..7a8fbe2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -157,10 +157,29 @@ static const struct snd_soc_dapm_route audio_map[] = {
{AFMR, NULL, Line In},
 };
 
+#define twl6040_disconnect_pin(dapm, connected, pin)   \
+   if (!connected) \
+   snd_soc_dapm_disable_pin(dapm, pin);
+
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 {
struct snd_soc_codec *codec = rtd-codec;
-   int ret, hs_trim;
+   struct snd_soc_card *card = codec-card;
+   struct snd_soc_dapm_context *dapm = codec-dapm;
+   struct omap_abe_twl6040_data *pdata = dev_get_platdata(card-dev);
+   int hs_trim;
+   int ret = 0;
+
+   /* Disable not connected paths if not used */
+   twl6040_disconnect_pin(dapm, pdata-has_hs, Headset Stereophone);
+   twl6040_disconnect_pin(dapm, pdata-has_hf, Ext Spk);
+   twl6040_disconnect_pin(dapm, pdata-has_ep, Earphone Spk);
+   twl6040_disconnect_pin(dapm, pdata-has_aux, Line Out);
+   twl6040_disconnect_pin(dapm, pdata-has_vibra, Vinrator);
+   twl6040_disconnect_pin(dapm, pdata-has_hsmic, Headset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_mainmic, Main Handset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_submic, Sub Handset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_afm, Line In);
 
/*
 * Configure McPDM offset cancellation based on the HSOTRIM value from
@@ -170,19 +189,17 @@ static int omapabe_twl6040_init(struct 
snd_soc_pcm_runtime *rtd)
omap_mcpdm_configure_dn_offsets(rtd, TWL6040_HSF_TRIM_LEFT(hs_trim),
TWL6040_HSF_TRIM_RIGHT(hs_trim));
 
-   /* Headset jack detection */
-   ret = snd_soc_jack_new(codec, Headset Jack,
-   SND_JACK_HEADSET, hs_jack);
-   if (ret)
-   return ret;
-
-   ret = snd_soc_jack_add_pins(hs_jack, ARRAY_SIZE(hs_jack_pins),
-   hs_jack_pins);
+   /* Headset jack detection only if it is supported */
+   if (pdata-jack_detection) {
+   ret = snd_soc_jack_new(codec, Headset Jack,
+   SND_JACK_HEADSET, hs_jack);
+   if (ret)
+   return ret;
 
-   if (machine_is_omap_4430sdp())
+   ret = snd_soc_jack_add_pins(hs_jack, ARRAY_SIZE(hs_jack_pins),
+   hs_jack_pins);
twl6040_hs_jack_detect(codec, hs_jack, SND_JACK_HEADSET);
-   else
-   snd_soc_jack_report(hs_jack, SND_JACK_HEADSET, 
SND_JACK_HEADSET);
+   }
 
return ret;
 }
-- 
1.7.8.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 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards

2011-12-22 Thread Peter Ujfalusi
Enable the ASoC audio support for PandaBoard family via
teh omap-abe-twl6040 machine driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/Kconfig |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 98410b8..2d19119 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -99,7 +99,8 @@ config SND_OMAP_SOC_SDP3430
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
tristate SoC Audio support for OMAP boards using ABE and twl6040 codec
-   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP_4430SDP
+   depends on TWL4030_CORE  SND_OMAP_SOC
+   depends on MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
select SND_OMAP_SOC_DMIC
select SND_OMAP_SOC_MCPDM
select SND_SOC_TWL6040
@@ -108,6 +109,8 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
  Say Y if you want to add support for SoC audio on OMAP boards using
  ABE and twl6040 codec. This driver currently supports:
  - SDP4430/Blaze boards
+ - PandaBoard (4430)
+ - PandaBoardES (4460)
 
 config SND_OMAP_SOC_OMAP4_HDMI
tristate SoC Audio support for Texas Instruments OMAP4 HDMI
-- 
1.7.8.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 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Peter Ujfalusi
PandaBoard has twl6040 codec for audio.
Register the omap4-abe-twl6040 platform device.
Add platform data to enable the twl6040 codec.
Since there is a difference in audio between  PandaBoard 4430
and PandaBoard ES (4460):
Use different name for the sound card:
OMAP4-Panda for PandaBoard 4430
OMAP4-PandaES for PandaBoard ES

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com

board: audio for panda
---
 arch/arm/mach-omap2/board-omap4panda.c |   56 +++-
 1 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index b6f1144..cb843fc 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -28,6 +28,7 @@
 #include linux/regulator/machine.h
 #include linux/regulator/fixed.h
 #include linux/wl12xx.h
+#include linux/platform_data/omap-abe-twl6040.h
 
 #include mach/hardware.h
 #include asm/hardware/gic.h
@@ -90,9 +91,31 @@ static struct platform_device leds_gpio = {
},
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+   /* Audio out */
+   .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* HandsFree through expasion connector */
+   .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
+   .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* PandaBoard: FM RX, PandaBoardES: audio in */
+   .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* No jack detection. */
+   .jack_detection = 0,
+};
+
+static struct platform_device panda_abe_audio = {
+   .name   = omap-abe-twl6040,
+   .id = -1,
+   .dev = {
+   .platform_data = panda_abe_audio_data,
+   },
+};
+
 static struct platform_device *panda_devices[] __initdata = {
leds_gpio,
wl1271_device,
+   panda_abe_audio,
 };
 
 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
@@ -251,8 +274,25 @@ static int __init omap4_twl6030_hsmmc_init(struct 
omap2_hsmmc_info *controllers)
return 0;
 }
 
+static struct twl4030_codec_data twl6040_codec = {
+   /* single-step ramp for headset and handsfree */
+   .hs_left_step   = 0x0f,
+   .hs_right_step  = 0x0f,
+   .hf_left_step   = 0x1d,
+   .hf_right_step  = 0x1d,
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+   .codec  = twl6040_codec,
+   .audpwron_gpio  = 127,
+   .naudint_irq= OMAP44XX_IRQ_SYS_2N,
+   .irq_base   = TWL6040_CODEC_IRQ_BASE,
+};
+
 /* Panda board uses the common PMIC configuration */
-static struct twl4030_platform_data omap4_panda_twldata;
+static struct twl4030_platform_data omap4_panda_twldata = {
+   .audio  = twl6040_audio,
+};
 
 /*
  * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -548,6 +588,19 @@ void omap4_panda_display_init(void)
omap_display_init(omap4_panda_dss_data);
 }
 
+static void omap4_panda_audio_init(void)
+{
+   if (cpu_is_omap4430()) {
+   /* PandaBoard 4430 */
+   panda_abe_audio_data.card_name = PandaBoard;
+   /* Audio in is connected to HSMIC */
+   panda_abe_audio_data.has_hsmic = 1;
+   } else {
+   /* PandaBoard ES */
+   panda_abe_audio_data.card_name = PandaBoardES;
+   }
+}
+
 static void __init omap4_panda_init(void)
 {
int package = OMAP_PACKAGE_CBS;
@@ -560,6 +613,7 @@ static void __init omap4_panda_init(void)
pr_err(error setting wl12xx data\n);
 
omap4_panda_i2c_init();
+   omap4_panda_audio_init();
platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
platform_device_register(omap_vwlan_device);
board_serial_init();
-- 
1.7.8.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 6/9] ASoC: omap-abe-twl6040: DAI link selection based on platform data

2011-12-22 Thread Peter Ujfalusi
We can have machines without DMIC connected. In this case there is
no need to create amother (unusable) capture PCM on the card.
The existence of the DMIC connection can be checked via
pdata-has_dmic.
Select the correct dai_link structure for the card based on
pdata-has_dmic.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   26 ++
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index cf3cb08..9e6e4c2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -212,7 +212,7 @@ static int omapabe_dmic_init(struct snd_soc_pcm_runtime 
*rtd)
 }
 
 /* Digital audio interface glue - connects codec -- CPU */
-static struct snd_soc_dai_link sdp4430_dai[] = {
+static struct snd_soc_dai_link twl6040_dmic_dai[] = {
{
.name = TWL6040,
.stream_name = TWL6040,
@@ -235,11 +235,21 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
},
 };
 
+static struct snd_soc_dai_link twl6040_only_dai[] = {
+   {
+   .name = TWL6040,
+   .stream_name = TWL6040,
+   .cpu_dai_name = omap-mcpdm,
+   .codec_dai_name = twl6040-legacy,
+   .platform_name = omap-pcm-audio,
+   .codec_name = twl6040-codec,
+   .init = omapabe_twl6040_init,
+   .ops = omapabe_ops,
+   },
+};
+
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-   .dai_link = sdp4430_dai,
-   .num_links = ARRAY_SIZE(sdp4430_dai),
-
.dapm_widgets = twl6040_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets),
.dapm_routes = audio_map,
@@ -266,6 +276,14 @@ static __devinit int omapabe_probe(struct platform_device 
*pdev)
return -ENODEV;
}
 
+   if (pdata-has_dmic) {
+   card-dai_link = twl6040_dmic_dai;
+   card-num_links = ARRAY_SIZE(twl6040_dmic_dai);
+   } else {
+   card-dai_link = twl6040_only_dai;
+   card-num_links = ARRAY_SIZE(twl6040_only_dai);
+   }
+
ret = snd_soc_register_card(card);
if (ret)
dev_err(pdev-dev, snd_soc_register_card() failed: %d\n,
-- 
1.7.8.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 5/9] ASoC: omap-abe-twl6040: Add complete DAPM routing

2011-12-22 Thread Peter Ujfalusi
SDP4430 is a reference platform, and as such it has all possible
audio routing implemented.
Correct the DAPM routing to be complete.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   46 ++--
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 18a25b0..cf3cb08 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -113,38 +113,48 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
 
 /* SDP4430 machine DAPM */
 static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
-   SND_SOC_DAPM_MIC(Ext Mic, NULL),
-   SND_SOC_DAPM_SPK(Ext Spk, NULL),
-   SND_SOC_DAPM_MIC(Headset Mic, NULL),
+   /* Outputs */
SND_SOC_DAPM_HP(Headset Stereophone, NULL),
SND_SOC_DAPM_SPK(Earphone Spk, NULL),
-   SND_SOC_DAPM_INPUT(FM Stereo In),
+   SND_SOC_DAPM_SPK(Ext Spk, NULL),
+   SND_SOC_DAPM_LINE(Line Out, NULL),
+   SND_SOC_DAPM_SPK(Vibrator, NULL),
+
+   /* Inputs */
+   SND_SOC_DAPM_MIC(Headset Mic, NULL),
+   SND_SOC_DAPM_MIC(Main Handset Mic, NULL),
+   SND_SOC_DAPM_MIC(Sub Handset Mic, NULL),
+   SND_SOC_DAPM_LINE(Line In, NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
-   /* External Mics: MAINMIC, SUBMIC with bias*/
-   {MAINMIC, NULL, Ext Mic},
-   {SUBMIC, NULL, Ext Mic},
-   {Ext Mic, NULL, Main Mic Bias},
+   /* Routings for outputs */
+   {Headset Stereophone, NULL, HSOL},
+   {Headset Stereophone, NULL, HSOR},
+
+   {Earphone Spk, NULL, EP},
 
-   /* External Speakers: HFL, HFR */
{Ext Spk, NULL, HFL},
{Ext Spk, NULL, HFR},
 
-   /* Headset Mic: HSMIC with bias */
+   {Line Out, NULL, AUXL},
+   {Line Out, NULL, AUXR},
+
+   {Vibrator, NULL, VIBRAL},
+   {Vibrator, NULL, VIBRAR},
+
+   /* Routings for inputs */
{HSMIC, NULL, Headset Mic},
{Headset Mic, NULL, Headset Mic Bias},
 
-   /* Headset Stereophone (Headphone): HSOL, HSOR */
-   {Headset Stereophone, NULL, HSOL},
-   {Headset Stereophone, NULL, HSOR},
+   {MAINMIC, NULL, Main Handset Mic},
+   {Main Handset Mic, NULL, Main Mic Bias},
 
-   /* Earphone speaker */
-   {Earphone Spk, NULL, EP},
+   {SUBMIC, NULL, Sub Handset Mic},
+   {Sub Handset Mic, NULL, Main Mic Bias},
 
-   /* Aux/FM Stereo In: AFML, AFMR */
-   {AFML, NULL, FM Stereo In},
-   {AFMR, NULL, FM Stereo In},
+   {AFML, NULL, Line In},
+   {AFMR, NULL, Line In},
 };
 
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.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: [GIT PULL] Borderline fixes for v3.2-rc6

2011-12-22 Thread Tony Lindgren
Hi Olof,

* Olof Johansson o...@lixom.net [111220 09:29]:
 On Tue, Dec 20, 2011 at 9:10 AM, Tony Lindgren t...@atomide.com wrote:
 
  I've branched it out into fixes-hwmod-regression with just that
  same commit in it. The second patch in this series will be pulled in
  with fixes-non-critical-part2. Updated pull request below.
 
 Thanks, I pulled fixes-hwmod-regression into fixes and fixes-hwmod
 into next/fixes-non-critical.

Just checking.. Looks like you pulled fixes-hwmod into a new branch
named fixes-non-critical-part2, but did not pull the same name branch
fixes-non-critical-part2 that I posted?

That's this pull request:

http://www.spinics.net/lists/linux-omap/msg62050.html

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: [GIT PULL] Borderline fixes for v3.2-rc6

2011-12-22 Thread Olof Johansson
On Thu, Dec 22, 2011 at 9:11 AM, Tony Lindgren t...@atomide.com wrote:
 Hi Olof,

 * Olof Johansson o...@lixom.net [111220 09:29]:
 On Tue, Dec 20, 2011 at 9:10 AM, Tony Lindgren t...@atomide.com wrote:
 
  I've branched it out into fixes-hwmod-regression with just that
  same commit in it. The second patch in this series will be pulled in
  with fixes-non-critical-part2. Updated pull request below.

 Thanks, I pulled fixes-hwmod-regression into fixes and fixes-hwmod
 into next/fixes-non-critical.

 Just checking.. Looks like you pulled fixes-hwmod into a new branch
 named fixes-non-critical-part2, but did not pull the same name branch
 fixes-non-critical-part2 that I posted?

 That's this pull request:

 http://www.spinics.net/lists/linux-omap/msg62050.html

Grmbl, thanks for catching that. I'll sort it out at this end.


-Olof
--
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: [GIT PULL] Borderline fixes for v3.2-rc6

2011-12-22 Thread Tony Lindgren
* Olof Johansson o...@lixom.net [111222 08:42]:
 On Thu, Dec 22, 2011 at 9:11 AM, Tony Lindgren t...@atomide.com wrote:
  Hi Olof,
 
  * Olof Johansson o...@lixom.net [111220 09:29]:
  On Tue, Dec 20, 2011 at 9:10 AM, Tony Lindgren t...@atomide.com wrote:
  
   I've branched it out into fixes-hwmod-regression with just that
   same commit in it. The second patch in this series will be pulled in
   with fixes-non-critical-part2. Updated pull request below.
 
  Thanks, I pulled fixes-hwmod-regression into fixes and fixes-hwmod
  into next/fixes-non-critical.
 
  Just checking.. Looks like you pulled fixes-hwmod into a new branch
  named fixes-non-critical-part2, but did not pull the same name branch
  fixes-non-critical-part2 that I posted?
 
  That's this pull request:
 
  http://www.spinics.net/lists/linux-omap/msg62050.html
 
 Grmbl, thanks for catching that. I'll sort it out at this end.

OK thanks!

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 v4 03/12] mfd: twl-core: Add initial DT support for twl4030/twl6030

2011-12-22 Thread Samuel Ortiz
Hi Benoit,

On Thu, Dec 22, 2011 at 03:56:37PM +0100, Benoit Cousson wrote:
 Add initial device-tree support for twl familly chips.
 The current version is missing the regulator entries due
 to the lack of DT regulator bindings for the moment.
 Only the simple sub-modules that do not depend on
 platform_data information can be initialized properly.
 
 Add irqdomain support.
 
 Add documentation for the Texas Instruments TWL Integrated Chip.
 
 Signed-off-by: Benoit Cousson b-cous...@ti.com
 Cc: Balaji T K balaj...@ti.com
 Cc: Graeme Gregory g...@slimlogic.co.uk
 Cc: Samuel Ortiz sa...@linux.intel.com
 ---
  .../devicetree/bindings/mfd/twl-familly.txt|   47 ++
  drivers/mfd/Kconfig|1 +
  drivers/mfd/twl-core.c |   51 
 +++-
  3 files changed, 98 insertions(+), 1 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/mfd/twl-familly.txt
Patch applied instead of the previous one, thanks for the quick fix.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
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: [GIT PULL] Non critical fixes for v3.3 merge window, part2

2011-12-22 Thread Olof Johansson
On Mon, Dec 19, 2011 at 12:23 PM, Tony Lindgren t...@atomide.com wrote:
 Resending with mailing lists in Cc.

 * Tony Lindgren t...@atomide.com [111219 11:45]:
 Hi Arnd  Olof,

 Please pull few non-critical fixes for v3.3 merge window from:

 git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
 fixes-non-critical-part2

 These will be needed for some omap hwmod and ehci changes I'll
 post pull requests for after this. Note that this is based on
 the earlier pull request for fixes, so those two fixes will also
 get pulled in if they don't make it to the -rc cycle.

 Regards,

 Tony


 The following changes since commit 4a4de1d9b47156525ceb46c7faf6ae4042d90aa7:
   Tony Lindgren (1):
         Merge branch 'hwmod_data_fixes_3.2rc' of 
 git://git.pwsan.com/linux-2.6 into fixes-hwmod

 are available in the git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap 
 fixes-non-critical-part2

Pulled into next/fixes-non-critical. Thanks!


-Olof
--
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/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 03:42:53PM +, Liam Girdwood wrote:
 On Thu, 2011-12-22 at 13:04 +, Mark Brown wrote:

  omap-abe-mcpdm-twl6040 please.  Seriously, just drop the abe - it's not
  an optional feature of the OMAP and the names are getting quite long.

 ABE can be an optional feature on OMAP (and quite an important one when
 it is used). Fwiw, we do have a mixture of users, most use the ABE but
 some don't, so it's best to specify ABE in the naming to avoid any
 confusion.

Do you mean to say that there are OMAP4 variants that don't have the
ABE or that some people choose not to do so for some reason, and unless
the ABE might not be there shouldn't the driver just support both ABE
and non-ABE paths anyway?  That's what the out of tree systems I've seen
have done, though the main use of the non-ABE paths has always been
confirming that issues are in the ABE.
--
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 0/5] OMAP4: Fix CLKR/FSR mux for port with 6 pin mode

2011-12-22 Thread Peter Ujfalusi
Hello,

This series will fix the CLKR/FSR signal mux configuration for OMAP4 devices.
McBSP4 has 6 pin configuration on McBSP4 port while OMAP2/3 has the same
capability on McBSP1 port.
The API for mux control will be simplified for the mcbsp users (ASoC).

The series depends on earlier series sent for mcbsp:
OMAP4: McBSP: Fix clock reparenting

I think the ASoC patch can go via linux-omap, since we do not have other changes
for McBSP coming via sound tree.

Regards,
Peter
---
Peter Ujfalusi (5):
  OMAP2/3: mcbsp: Check McBSP port number in CLKR/FSR mux callback
  OMAP: mcbsp: Signle function for CLKR/FSR source mux configuration
  ASoC: omap-mcbsp: Use the new interface for configuring CLKR/FSR mux
  OMAP: mcbsp: Remove old CLKR/FSR mux functions
  OMAP4: mcbsp: Callback function for McBSP4 CLKR/FSR mux selection

 arch/arm/mach-omap2/mcbsp.c |   47 +
 arch/arm/plat-omap/include/plat/mcbsp.h |   15 --
 arch/arm/plat-omap/mcbsp.c  |   49 +++
 sound/soc/omap/omap-mcbsp.c |   12 +--
 4 files changed, 85 insertions(+), 38 deletions(-)

-- 
1.7.8.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 1/5] OMAP2/3: mcbsp: Check McBSP port number in CLKR/FSR mux callback

2011-12-22 Thread Peter Ujfalusi
CLKR/FSR mux is only possible on port 1.
Make sure that we only change the mux if the call is made with the
correct mcbsp device.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/mcbsp.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 829f4c7..269765c 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -38,8 +38,13 @@
 static int omap2_mcbsp1_mux_rx_clk(struct device *dev, const char *signal,
   const char *src)
 {
+   struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
u32 v;
 
+   /* Only McBSP1 have 6 pin configuration (CLKR/FSR source selectable) */
+   if (mcbsp-id != 0)
+   return -EINVAL;
+
v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
 
if (!strcmp(signal, clkr)) {
-- 
1.7.8.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 2/5] OMAP: mcbsp: Signle function for CLKR/FSR source mux configuration

2011-12-22 Thread Peter Ujfalusi
Use single function to configure the CLKR/FSR mux configuration.
OMAP2/3 has 6 pin configuration on McBSP1 instance, while on OMAP4
McBSP4 instance have the 6 pin configuration.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/include/plat/mcbsp.h |   13 +--
 arch/arm/plat-omap/mcbsp.c  |   35 +++
 2 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h 
b/arch/arm/plat-omap/include/plat/mcbsp.h
index 8fa74e2..7f9a745 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -242,13 +242,11 @@ enum {
 #define RFSREN 0x0002
 #define RSYNCERREN 0x0001
 
-/* CLKR signal muxing options */
-#define CLKR_SRC_CLKR  0
-#define CLKR_SRC_CLKX  1
-
-/* FSR signal muxing options */
-#define FSR_SRC_FSR0
-#define FSR_SRC_FSX1
+/* Clock signal muxing options */
+#define CLKR_SRC_CLKR  0 /* CLKR signal is from the CLKR pin */
+#define CLKR_SRC_CLKX  1 /* CLKR signal is from the CLKX pin */
+#define FSR_SRC_FSR2 /* FSR signal is from the FSR pin */
+#define FSR_SRC_FSX3 /* FSR signal is from the FSX pin */
 
 /* McBSP functional clock sources */
 #define MCBSP_CLKS_PRCM_SRC0
@@ -381,6 +379,7 @@ extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id);
 /* McBSP signal muxing API */
 void omap2_mcbsp1_mux_clkr_src(u8 mux);
 void omap2_mcbsp1_mux_fsr_src(u8 mux);
+int omap_mcbsp_6pin_src_mux(unsigned int id, u8 mux);
 
 int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream);
 int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream);
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index f2eb1bb..501c6d1 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -957,6 +957,41 @@ void omap2_mcbsp1_mux_fsr_src(u8 mux)
 }
 EXPORT_SYMBOL(omap2_mcbsp1_mux_fsr_src);
 
+int omap_mcbsp_6pin_src_mux(unsigned int id, u8 mux)
+{
+   struct omap_mcbsp *mcbsp;
+   const char *signal, *src;
+   int ret = 0;
+
+   if (!omap_mcbsp_check_valid_id(id)) {
+   printk(KERN_ERR %s: Invalid id (%d)\n, __func__, id + 1);
+   return -EINVAL;
+   }
+
+   mcbsp = id_to_mcbsp_ptr(id);
+
+   if (mux == CLKR_SRC_CLKR) {
+   signal = clkr;
+   src = clkr;
+   } else if (mux == CLKR_SRC_CLKX) {
+   signal = clkr;
+   src = clkx;
+   } else if (mux == FSR_SRC_FSR) {
+   signal = fsr;
+   src = fsr;
+   } else if (mux == FSR_SRC_FSX) {
+   signal = fsr;
+   src = fsx;
+   } else
+   return -EINVAL;
+
+   if (mcbsp-pdata-mux_signal)
+   ret = mcbsp-pdata-mux_signal(mcbsp-dev, signal, src);
+
+   return ret;
+}
+EXPORT_SYMBOL(omap_mcbsp_6pin_src_mux);
+
 #define max_thres(m)   (mcbsp-pdata-buffer_size)
 #define valid_threshold(m, val)((val) = max_thres(m))
 #define THRESHOLD_PROP_BUILDER(prop)   \
-- 
1.7.8.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 4/5] OMAP: mcbsp: Remove old CLKR/FSR mux functions

2011-12-22 Thread Peter Ujfalusi
New, single function has replaced the old mux configuration API for
CLKR/FSR configuration.
Remove the unused code.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/include/plat/mcbsp.h |2 -
 arch/arm/plat-omap/mcbsp.c  |   36 ---
 2 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h 
b/arch/arm/plat-omap/include/plat/mcbsp.h
index 7f9a745..89aa33b 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -377,8 +377,6 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx);
 extern int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id);
 
 /* McBSP signal muxing API */
-void omap2_mcbsp1_mux_clkr_src(u8 mux);
-void omap2_mcbsp1_mux_fsr_src(u8 mux);
 int omap_mcbsp_6pin_src_mux(unsigned int id, u8 mux);
 
 int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream);
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 501c6d1..c48d974 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -921,42 +921,6 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
 }
 EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
 
-void omap2_mcbsp1_mux_clkr_src(u8 mux)
-{
-   struct omap_mcbsp *mcbsp;
-   const char *src;
-
-   if (mux == CLKR_SRC_CLKR)
-   src = clkr;
-   else if (mux == CLKR_SRC_CLKX)
-   src = clkx;
-   else
-   return;
-
-   mcbsp = id_to_mcbsp_ptr(0);
-   if (mcbsp-pdata-mux_signal)
-   mcbsp-pdata-mux_signal(mcbsp-dev, clkr, src);
-}
-EXPORT_SYMBOL(omap2_mcbsp1_mux_clkr_src);
-
-void omap2_mcbsp1_mux_fsr_src(u8 mux)
-{
-   struct omap_mcbsp *mcbsp;
-   const char *src;
-
-   if (mux == FSR_SRC_FSR)
-   src = fsr;
-   else if (mux == FSR_SRC_FSX)
-   src = fsx;
-   else
-   return;
-
-   mcbsp = id_to_mcbsp_ptr(0);
-   if (mcbsp-pdata-mux_signal)
-   mcbsp-pdata-mux_signal(mcbsp-dev, fsr, src);
-}
-EXPORT_SYMBOL(omap2_mcbsp1_mux_fsr_src);
-
 int omap_mcbsp_6pin_src_mux(unsigned int id, u8 mux)
 {
struct omap_mcbsp *mcbsp;
-- 
1.7.8.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 3/5] ASoC: omap-mcbsp: Use the new interface for configuring CLKR/FSR mux

2011-12-22 Thread Peter Ujfalusi
Switch using the new API to configure the 6 pin port's CLKR/FSR mux
configuration.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-mcbsp.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 0173719..b9b0a9b 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -575,22 +575,26 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct 
snd_soc_dai *cpu_dai,
case OMAP_MCBSP_CLKR_SRC_CLKR:
if (cpu_class_is_omap1())
break;
-   omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKR);
+   err = omap_mcbsp_6pin_src_mux(mcbsp_data-bus_id,
+   CLKR_SRC_CLKR);
break;
case OMAP_MCBSP_CLKR_SRC_CLKX:
if (cpu_class_is_omap1())
break;
-   omap2_mcbsp1_mux_clkr_src(CLKR_SRC_CLKX);
+   err = omap_mcbsp_6pin_src_mux(mcbsp_data-bus_id,
+   CLKR_SRC_CLKX);
break;
case OMAP_MCBSP_FSR_SRC_FSR:
if (cpu_class_is_omap1())
break;
-   omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSR);
+   err = omap_mcbsp_6pin_src_mux(mcbsp_data-bus_id,
+   FSR_SRC_FSR);
break;
case OMAP_MCBSP_FSR_SRC_FSX:
if (cpu_class_is_omap1())
break;
-   omap2_mcbsp1_mux_fsr_src(FSR_SRC_FSX);
+   err = omap_mcbsp_6pin_src_mux(mcbsp_data-bus_id,
+   FSR_SRC_FSX);
break;
default:
err = -ENODEV;
-- 
1.7.8.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 3/5] ASoC: omap-mcbsp: Use the new interface for configuring CLKR/FSR mux

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 07:31:44PM +0200, Peter Ujfalusi wrote:
 Switch using the new API to configure the 6 pin port's CLKR/FSR mux
 configuration.

Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
--
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] input: serio: ams-delta: toggle keyboard power over GPIO

2011-12-22 Thread Dmitry Torokhov
On Wed, Dec 21, 2011 at 08:55:09PM +0100, Janusz Krzysztofik wrote:
 On Wednesday 21 of December 2011 at 20:09:45, Tony Lindgren wrote:
  * Janusz Krzysztofik jkrzy...@tis.icnet.pl [111220 13:39]:
   Don't use Amstrad Delta custom I/O functions once GPIO interface is
   available for the underlying hardware.
   
   While requesting and initializing GPIO pins used, also take care of one
   extra pin KEYBRD_DATAOUT which, even if not used by the driver, belongs
   to the device and affects its functioning.
   
   Once done, move the driver initialization back to the device_initcall
   level, reverting the temporary chane introduced with patch 1/7 ARM:
   OMAP1: ams-delta: register latch dependent devices later.  That change
   is no longer required once the driver takes care of registering used
   GPIO pins, and it's better to initialize the device before others using
   the latch2 based GPIO pins, otherwise a garbage is reported on boot,
   perhaps due to random data already captured by the FIQ handler while the
   keyboard related latch bits are written with random values during
   initialization of those other latch2 dependent devices.
   
   Depends on patch 2/7 ARM: OMAP1: ams-delta: convert latches to
   basic_mmio_gpio
   
   Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl
  
  I'm assuming Dmitry's ack for an earlier version of this patch also
  covers this one when applying.
 
 Hi Dmitry,
 Can we assume your ack still valid for this version?
 

Yes, please merge with your other changes.

BTW, if you could rename :static struct gpio _gpios to ams_delta_gpios
that would be even better.

Thanks!

-- 
Dmitry
--
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/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Girdwood, Liam
On 22 December 2011 17:28, Mark Brown
broo...@opensource.wolfsonmicro.com wrote:
 On Thu, Dec 22, 2011 at 03:42:53PM +, Liam Girdwood wrote:
 On Thu, 2011-12-22 at 13:04 +, Mark Brown wrote:

  omap-abe-mcpdm-twl6040 please.  Seriously, just drop the abe - it's not
  an optional feature of the OMAP and the names are getting quite long.

 ABE can be an optional feature on OMAP (and quite an important one when
 it is used). Fwiw, we do have a mixture of users, most use the ABE but
 some don't, so it's best to specify ABE in the naming to avoid any
 confusion.

 Do you mean to say that there are OMAP4 variants that don't have the
 ABE or that some people choose not to do so for some reason, and unless
 the ABE might not be there shouldn't the driver just support both ABE
 and non-ABE paths anyway?

There nothing stopping drivers from using McBSP/McPDM etc directly
without the ABE as the do in OMAP3. Some people do this direct path
for specific drivers.

 That's what the out of tree systems I've seen
 have done, though the main use of the non-ABE paths has always been
 confirming that issues are in the ABE.

Yep, we do sometimes add the legacy or direct DAI paths into ABE
mach drivers as well (but really just for debug purposes). These DAIs
are not used for any other audio use case except sometimes to debug.

Liam
--
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 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Peter Ujfalusi
Hi Mark,

On 12/22/2011 07:32 PM, Mark Brown wrote:
 It'd be better to put this before all the renaming and whatever, it's a
 mostly separate change and it'd save having to look at it again.

I was planning to leave it in this place for the v3 series.
When I started to implement the feature based support for the machine
driver I realized that I need to separate the Main Mic, and Sub Mic from
each other.
I remembered your patch(s) doing the conversion from MICBIAS to SUPPLY,
so I did the same thing with the twl6040 codec.
Since the rename of the machine driver has been taken by Liam, a patch
alone for the codec would break the old machine driver.
I can move it forward in the series, but I don't see the benefit.

-- 
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] input: serio: ams-delta: toggle keyboard power over GPIO

2011-12-22 Thread Tony Lindgren
* Dmitry Torokhov dmitry.torok...@gmail.com [111222 09:13]:
 On Wed, Dec 21, 2011 at 08:55:09PM +0100, Janusz Krzysztofik wrote:
  On Wednesday 21 of December 2011 at 20:09:45, Tony Lindgren wrote:
   * Janusz Krzysztofik jkrzy...@tis.icnet.pl [111220 13:39]:
Don't use Amstrad Delta custom I/O functions once GPIO interface is
available for the underlying hardware.

While requesting and initializing GPIO pins used, also take care of one
extra pin KEYBRD_DATAOUT which, even if not used by the driver, belongs
to the device and affects its functioning.

Once done, move the driver initialization back to the device_initcall
level, reverting the temporary chane introduced with patch 1/7 ARM:
OMAP1: ams-delta: register latch dependent devices later.  That change
is no longer required once the driver takes care of registering used
GPIO pins, and it's better to initialize the device before others using
the latch2 based GPIO pins, otherwise a garbage is reported on boot,
perhaps due to random data already captured by the FIQ handler while the
keyboard related latch bits are written with random values during
initialization of those other latch2 dependent devices.

Depends on patch 2/7 ARM: OMAP1: ams-delta: convert latches to
basic_mmio_gpio

Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl
   
   I'm assuming Dmitry's ack for an earlier version of this patch also
   covers this one when applying.
  
  Hi Dmitry,
  Can we assume your ack still valid for this version?
  
 
 Yes, please merge with your other changes.

OK thanks.
 
 BTW, if you could rename :static struct gpio _gpios to ams_delta_gpios
 that would be even better.

Done, pushing into omap1-part2 branch with the updated patch below.

Regards,

Tony


From: Janusz Krzysztofik jkrzy...@tis.icnet.pl
Date: Tue, 20 Dec 2011 23:10:34 +0100
Subject: [PATCH] input: serio: ams-delta: toggle keyboard power over GPIO

Don't use Amstrad Delta custom I/O functions once GPIO interface is
available for the underlying hardware.

While requesting and initializing GPIO pins used, also take care of one
extra pin KEYBRD_DATAOUT which, even if not used by the driver, belongs
to the device and affects its functioning.

Once done, move the driver initialization back to the device_initcall
level, reverting the temporary chane introduced with patch 1/7 ARM:
OMAP1: ams-delta: register latch dependent devices later.  That change
is no longer required once the driver takes care of registering used
GPIO pins, and it's better to initialize the device before others using
the latch2 based GPIO pins, otherwise a garbage is reported on boot,
perhaps due to random data already captured by the FIQ handler while the
keyboard related latch bits are written with random values during
initialization of those other latch2 dependent devices.

Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl
Acked-by: Dmitry Torokhov d...@mail.ru
[t...@atomide.com: renamed _gpios to ams_delta_gpios]
Signed-off-by: Tony Lindgren t...@atomide.com

diff --git a/arch/arm/mach-omap1/board-ams-delta.c 
b/arch/arm/mach-omap1/board-ams-delta.c
index 3aba8f9..673cf21 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -227,16 +227,6 @@ static struct gpio latch_gpios[] __initconst = {
.label  = dockit2,
},
{
-   .gpio   = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
-   .flags  = GPIOF_OUT_INIT_LOW,
-   .label  = keybrd_pwr,
-   },
-   {
-   .gpio   = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
-   .flags  = GPIOF_OUT_INIT_LOW,
-   .label  = keybrd_dataout,
-   },
-   {
.gpio   = AMS_DELTA_GPIO_PIN_SCARD_RSTIN,
.flags  = GPIOF_OUT_INIT_LOW,
.label  = scard_rstin,
diff --git a/arch/arm/plat-omap/include/plat/board-ams-delta.h 
b/arch/arm/plat-omap/include/plat/board-ams-delta.h
index e9ad673..027e79e 100644
--- a/arch/arm/plat-omap/include/plat/board-ams-delta.h
+++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h
@@ -28,8 +28,6 @@
 
 #if defined (CONFIG_MACH_AMS_DELTA)
 
-#define AMD_DELTA_LATCH2_KEYBRD_PWR0x0100
-#define AMD_DELTA_LATCH2_KEYBRD_DATA   0x0200
 #define AMD_DELTA_LATCH2_SCARD_RSTIN   0x0400
 #define AMD_DELTA_LATCH2_SCARD_CMDVCC  0x0800
 #define AMS_DELTA_LATCH2_MODEM_NRESET  0x1000
diff --git a/drivers/input/serio/ams_delta_serio.c 
b/drivers/input/serio/ams_delta_serio.c
index 835d37a..0571e2e 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void 
*dev_id)
 static int ams_delta_serio_open(struct serio *serio)
 {
/* enable keyboard */
-   ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR,
-   AMD_DELTA_LATCH2_KEYBRD_PWR);
+   

Re: [PATCH v2 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Peter Ujfalusi
Hi Tony,

On 12/22/2011 07:32 PM, Tony Lindgren wrote:
 Hi,
 
 @@ -548,6 +588,19 @@ void omap4_panda_display_init(void)
  omap_display_init(omap4_panda_dss_data);
  }
  
 +static void omap4_panda_audio_init(void)
 +{
 +if (cpu_is_omap4430()) {
 +/* PandaBoard 4430 */
 +panda_abe_audio_data.card_name = PandaBoard;
 +/* Audio in is connected to HSMIC */
 +panda_abe_audio_data.has_hsmic = 1;
 +} else {
 +/* PandaBoard ES */
 +panda_abe_audio_data.card_name = PandaBoardES;
 +}
 +}
 +
 
 Please move the cpu_is_omap4430() check from audio_init to..
 
  static void __init omap4_panda_init(void)
  {
  int package = OMAP_PACKAGE_CBS;
 @@ -560,6 +613,7 @@ static void __init omap4_panda_init(void)
  pr_err(error setting wl12xx data\n);
  
  omap4_panda_i2c_init();
 +omap4_panda_audio_init();
  platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
  platform_device_register(omap_vwlan_device);
  board_serial_init();
 
 ..omap4_panda_init() instead and set some flag that other
 devices can use too so we don't have cpu_is_omap tests
 for each init function. I'd assume that will be needed for
 other devices too, but that's just a guess of course :)

I was planning to have omap4_panda_init_rev(), which would be called
just before the i2c_init().
If other drivers need to differentiate between Panda and PandaES they
can add their code there.

We can use GPIOs to get the board ID, I'm looking at those for a
followup patch.
The only issue is that the ID1 GPIO number is different between 4430,
and 4460 based Panda.
We can have similar revision handling as we have for Beagle at the end.

-- 
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: [GIT PULL] ARM: OMAP: device PM constraints: preparatory support

2011-12-22 Thread Tony Lindgren
* Paul Walmsley p...@pwsan.com [111220 11:21]:
 Hi Tony
 
 These patches prepare for the introduction of the powerdomain device PM 
 constraints, via the standard Linux device PM mechanism that Rafael 
 Wysocki introduced.
 
 After the powerdomain device PM constraints go in, we should be able to 
 remove some of the OMAP PM interface (currently via platform_data function 
 pointers) currently in our tree.

Thanks pulling these into hwmod-part2, no idea if we can still get
these in as it's so close to the merge window.

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 v2 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Mark Brown
On Thu, Dec 22, 2011 at 08:02:07PM +0200, Peter Ujfalusi wrote:

 I can move it forward in the series, but I don't see the benefit.

Well, it'd have been applied already if that had been done.
--
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 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [111222 09:36]:
 Hi Tony,
 
 On 12/22/2011 07:32 PM, Tony Lindgren wrote:
  Hi,
  
  @@ -548,6 +588,19 @@ void omap4_panda_display_init(void)
 omap_display_init(omap4_panda_dss_data);
   }
   
  +static void omap4_panda_audio_init(void)
  +{
  +  if (cpu_is_omap4430()) {
  +  /* PandaBoard 4430 */
  +  panda_abe_audio_data.card_name = PandaBoard;
  +  /* Audio in is connected to HSMIC */
  +  panda_abe_audio_data.has_hsmic = 1;
  +  } else {
  +  /* PandaBoard ES */
  +  panda_abe_audio_data.card_name = PandaBoardES;
  +  }
  +}
  +
  
  Please move the cpu_is_omap4430() check from audio_init to..
  
   static void __init omap4_panda_init(void)
   {
 int package = OMAP_PACKAGE_CBS;
  @@ -560,6 +613,7 @@ static void __init omap4_panda_init(void)
 pr_err(error setting wl12xx data\n);
   
 omap4_panda_i2c_init();
  +  omap4_panda_audio_init();
 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
 platform_device_register(omap_vwlan_device);
 board_serial_init();
  
  ..omap4_panda_init() instead and set some flag that other
  devices can use too so we don't have cpu_is_omap tests
  for each init function. I'd assume that will be needed for
  other devices too, but that's just a guess of course :)
 
 I was planning to have omap4_panda_init_rev(), which would be called
 just before the i2c_init().
 If other drivers need to differentiate between Panda and PandaES they
 can add their code there.

OK, sounds good to me. Maybe just make omap4_panda_init_rev() do
the cpu_is_omap check for now and then you can patch in the dynamic
detection later on?
 
 We can use GPIOs to get the board ID, I'm looking at those for a
 followup patch.
 The only issue is that the ID1 GPIO number is different between 4430,
 and 4460 based Panda.
 We can have similar revision handling as we have for Beagle at the end.

OK great.

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 01/10] arm: omap4: fix kconfig warning

2011-12-22 Thread Tony Lindgren
* Felipe Contreras felipe.contre...@gmail.com [111219 16:11]:
 warning: (ARCH_OMAP4  ARCH_VEXPRESS_CA9X4) selects ARM_ERRATA_720789 which 
 has unmet direct dependencies (CPU_V7  SMP)

Thanks applying into fixes-non-critical-part3.

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 03/10] arm: omap2: fix omap3 touchbook kconfig warning

2011-12-22 Thread Tony Lindgren
* Felipe Contreras felipe.contre...@gmail.com [111219 16:11]:
 warning: (MACH_OMAP3_TOUCHBOOK  DRM_RADEON_KMS  DRM_I915  STUB_POULSBO 
  FB_BACKLIGHT  USB_APPLEDISPLAY  FB_OLPC_DCON  ASUS_LAPTOP  
 SONY_LAPTOP  THINKPAD_ACPI  EEEPC_LAPTOP  ACPI_ASUS  ACPI_CMPC  
 SAMSUNG_Q10) selects BACKLIGHT_CLASS_DEVICE which has unmet direct 
 dependencies (HAS_IOMEM  BACKLIGHT_LCD_SUPPORT)
 
 A lot of boards need BACKLIGHT_CLASS_DEVICE for the framebuffers to
 work, but it's not *needed* for the device itself. It might be nice to
 enable it by default somewhoe if graphics stuff is enabled, but that's
 another story.

Thanks applying into fixes-non-critical-part3.

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 04/10] arm: omap2: fix regulator warnings

2011-12-22 Thread Tony Lindgren
* Felipe Contreras felipe.contre...@gmail.com [111219 16:11]:
 warning: (MACH_OMAP_ZOOM2  MACH_OMAP_ZOOM3  MACH_OMAP_4430SDP  
 MACH_OMAP4_PANDA  TPS6105X) selects REGULATOR_FIXED_VOLTAGE which has unmet 
 direct dependencies (REGULATOR)

Thanks applying into fixes-non-critical-part3.

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 v2 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Peter Ujfalusi
On 12/22/2011 08:15 PM, Tony Lindgren wrote:
 OK, sounds good to me. Maybe just make omap4_panda_init_rev() do
 the cpu_is_omap check for now and then you can patch in the dynamic
 detection later on?

Yes, this is exactly what will be done for v3.

 We can use GPIOs to get the board ID, I'm looking at those for a
 followup patch.
 The only issue is that the ID1 GPIO number is different between 4430,
 and 4460 based Panda.
 We can have similar revision handling as we have for Beagle at the end.
 
 OK great.

Thanks,
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] ARM: OMAP: hsmmc: add max_freq field

2011-12-22 Thread Tony Lindgren
* Daniel Mack zon...@gmail.com [111214 04:51]:
 External circuitry like level shifters may limit the maximum operation
 speed of the hsmmc controller. Add a field to struct omap2_hsmmc_info
 so boards can adjust the setting on demand.
 
 Signed-off-by: Daniel Mack zon...@gmail.com
 Cc: Tony Lindgren t...@atomide.com

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

 ---
  arch/arm/mach-omap2/hsmmc.c   |1 +
  arch/arm/mach-omap2/hsmmc.h   |2 ++
  drivers/mmc/host/omap_hsmmc.c |8 ++--
  3 files changed, 9 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
 index f4a1020..4c7bc36 100644
 --- a/arch/arm/mach-omap2/hsmmc.c
 +++ b/arch/arm/mach-omap2/hsmmc.c
 @@ -298,6 +298,7 @@ static int __init omap_hsmmc_pdata_init(struct 
 omap2_hsmmc_info *c,
   mmc-slots[0].caps = c-caps;
   mmc-slots[0].internal_clock = !c-ext_clock;
   mmc-dma_mask = 0x;
 + mmc-max_freq = c-max_freq;
   if (cpu_is_omap44xx())
   mmc-reg_offset = OMAP4_MMC_REG_OFFSET;
   else
 diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
 index f757e78..65a8c12 100644
 --- a/arch/arm/mach-omap2/hsmmc.h
 +++ b/arch/arm/mach-omap2/hsmmc.h
 @@ -25,6 +25,8 @@ struct omap2_hsmmc_info {
   char*name;  /* or NULL for default */
   struct device *dev; /* returned: pointer to mmc adapter */
   int ocr_mask;   /* temporary HACK */
 + int max_freq;   /* maximum clock, if constrained by external
 +  * circuitry, or 0 for default */
   /* Remux (pad configuration) when powering on/off */
   void (*remux)(struct device *dev, int slot, int power_on);
   /* init some special card */
 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index 101cd31..8215ef9 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -1927,8 +1927,12 @@ static int __init omap_hsmmc_probe(struct 
 platform_device *pdev)
   if (mmc_slot(host).vcc_aux_disable_is_sleep)
   mmc_slot(host).no_off = 1;
  
 - mmc-f_min  = OMAP_MMC_MIN_CLOCK;
 - mmc-f_max  = OMAP_MMC_MAX_CLOCK;
 + mmc-f_min = OMAP_MMC_MIN_CLOCK;
 +
 + if (pdata-max_freq  0)
 + mmc-f_max = pdata-max_freq;
 + else
 + mmc-f_max = OMAP_MMC_MAX_CLOCK;
  
   spin_lock_init(host-irq_lock);
  
 -- 
 1.7.7.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


[PATCH v3 0/9] OMAP4: ASoC: Support for PandaBoard family

2011-12-22 Thread Peter Ujfalusi
Hello,

the following series will add ASoC support for PandaBoards.
PandaBoards have different audio routings compared to SDP4430/Blaze boards, but
the differences not that big to justify a new ASoC machine driver.

This series is based on the first three patch from the v1 sereis (those, which
has been applied by Liam).

Changes since v2:
- Remove direct board dependency for the ASoC machine driver (replaced by
  ARCH_OMAP4)
- mach-omap2/board-omap4panda: Generic board revision handling function instead
  of dedicated for audio.
- Macro twl6040_disconnect_pin replaced with a function

Changes since v1:
As suggested by Mark the platform data, machine driver has been converted to
process feature flags instead of Board IDs.
- The ASoC machine driver registers all DAPM widgets. Based on the received
  configuration it will disable the unused paths
- PCM for dmic is only created, if the board has digital mic conencted
- Jack functionality will be only used on boards supporting it
- Sound card name for SDP4430 has net been changed

Regards,
Peter
---
Peter Ujfalusi (9):
  include: platform_data: Platform data header for OMAP4 ASoC audio
  OMAP4: 4430sdp: Register platform device for OMAP4 audio
  ASoC: omap-abe-twl6040: Convert to platform deriver
  ASoC: twl6040: Convert MICBIAS to SUPPLY widget
  ASoC: omap-abe-twl6040: Add complete DAPM routing
  ASoC: omap-abe-twl6040: DAI link selection based on platform data
  ASoC: omap-abe-twl6040: Configure card according to platform data
  OMAP4: omap4panda: Enable audio support
  ASoC: Kconfig: OMAP4: Enable support for PandaBoards

 arch/arm/mach-omap2/board-4430sdp.c|   27 
 arch/arm/mach-omap2/board-omap4panda.c |   57 -
 include/linux/platform_data/omap-abe-twl6040.h |   48 +++
 sound/soc/codecs/twl6040.c |   16 +-
 sound/soc/omap/Kconfig |4 +-
 sound/soc/omap/omap-abe-twl6040.c  |  181 
 6 files changed, 263 insertions(+), 70 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

-- 
1.7.8.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 v3 1/9] include: platform_data: Platform data header for OMAP4 ASoC audio

2011-12-22 Thread Peter Ujfalusi
Include file to be used with the upcoming ASoC machine driver
for OMAP platform using ABE with twl6040 codec.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 include/linux/platform_data/omap-abe-twl6040.h |   48 
 1 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/platform_data/omap-abe-twl6040.h

diff --git a/include/linux/platform_data/omap-abe-twl6040.h 
b/include/linux/platform_data/omap-abe-twl6040.h
new file mode 100644
index 000..286f644
--- /dev/null
+++ b/include/linux/platform_data/omap-abe-twl6040.h
@@ -0,0 +1,48 @@
+/**
+ * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
+ * All rights reserved.
+ *
+ * Author: Peter Ujfalusi peter.ujfal...@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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _OMAP_ABE_TWL6040_H_
+#define _OMAP_ABE_TWL6040_H_
+
+/* To select if only one channel is connected in a stereo port */
+#define ABE_TWL6040_LEFT   (1  0)
+#define ABE_TWL6040_RIGHT  (1  1)
+
+struct omap_abe_twl6040_data {
+   char *card_name;
+   /* Feature flags for connected audio pins */
+   u8  has_hs;
+   u8  has_hf;
+   boolhas_ep;
+   u8  has_aux;
+   u8  has_vibra;
+   boolhas_dmic;
+   boolhas_hsmic;
+   boolhas_mainmic;
+   boolhas_submic;
+   u8  has_afm;
+   /* Other features */
+   booljack_detection; /* board can detect jack events */
+};
+
+#endif /* _OMAP_ABE_TWL6040_H_ */
-- 
1.7.8.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 v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio

2011-12-22 Thread Peter Ujfalusi
To avoid breakage in audio support with the coming change
in ASoC machine driver (conversion to platfrom device).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Santosh Shilimkar santosh.shilim...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 21b62bd..394cbab 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -41,6 +41,7 @@
 #include video/omap-panel-nokia-dsi.h
 #include video/omap-panel-picodlp.h
 #include linux/wl12xx.h
+#include linux/platform_data/omap-abe-twl6040.h
 
 #include mux.h
 #include hsmmc.h
@@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
.id = -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+   .card_name = SDP4430,
+   .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_ep = 1,
+   .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   .has_vibra  = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+   .has_dmic   = 1,
+   .has_hsmic  = 1,
+   .has_mainmic= 1,
+   .has_submic = 1,
+   .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+   .jack_detection = 1,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+   .name   = omap-abe-twl6040,
+   .id = -1,
+   .dev = {
+   .platform_data = sdp4430_abe_audio_data,
+   },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_gpio_keys_device,
sdp4430_leds_gpio,
sdp4430_leds_pwm,
sdp4430_vbat,
sdp4430_dmic_codec,
+   sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.8.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 v3 3/9] ASoC: omap-abe-twl6040: Convert to platform deriver

2011-12-22 Thread Peter Ujfalusi
Convert the OMAP4 ABE/TWL6040 machine driver to platform
driver.
For the card name use the string provided via platform data.
The card's name for OMAP4 SDP4430 has been changed:
SDP4430 - OMAP4-SDP4430

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   59 ++--
 1 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 9c6d97a..4974ea1 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -23,6 +23,7 @@
 #include linux/clk.h
 #include linux/platform_device.h
 #include linux/mfd/twl6040.h
+#include linux/platform_data/omap-abe-twl6040.h
 #include linux/module.h
 
 #include sound/core.h
@@ -226,7 +227,6 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
 
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-   .name = SDP4430,
.dai_link = sdp4430_dai,
.num_links = ARRAY_SIZE(sdp4430_dai),
 
@@ -236,43 +236,56 @@ static struct snd_soc_card omapabe_card = {
.num_dapm_routes = ARRAY_SIZE(audio_map),
 };
 
-static struct platform_device *omapabe_snd_device;
-
-static int __init omapabe_soc_init(void)
+static __devinit int omapabe_probe(struct platform_device *pdev)
 {
+   struct omap_abe_twl6040_data *pdata = dev_get_platdata(pdev-dev);
+   struct snd_soc_card *card = omapabe_card;
int ret;
 
-   if (!machine_is_omap_4430sdp())
-   return -ENODEV;
-   printk(KERN_INFO SDP4430 SoC init\n);
+   card-dev = pdev-dev;
 
-   omapabe_snd_device = platform_device_alloc(soc-audio, -1);
-   if (!omapabe_snd_device) {
-   printk(KERN_ERR Platform device allocation failed\n);
-   return -ENOMEM;
+   if (!pdata) {
+   dev_err(pdev-dev, Missing pdata\n);
+   return -ENODEV;
}
 
-   platform_set_drvdata(omapabe_snd_device, omapabe_card);
+   if (pdata-card_name) {
+   card-name = pdata-card_name;
+   } else {
+   dev_err(pdev-dev, Card name is not provided\n);
+   return -ENODEV;
+   }
 
-   ret = platform_device_add(omapabe_snd_device);
+   ret = snd_soc_register_card(card);
if (ret)
-   goto err;
-
-   return 0;
+   dev_err(pdev-dev, snd_soc_register_card() failed: %d\n,
+   ret);
 
-err:
-   printk(KERN_ERR Unable to add platform device\n);
-   platform_device_put(omapabe_snd_device);
return ret;
 }
-module_init(omapabe_soc_init);
 
-static void __exit omapabe_soc_exit(void)
+static int __devexit omapabe_remove(struct platform_device *pdev)
 {
-   platform_device_unregister(omapabe_snd_device);
+   struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+   snd_soc_unregister_card(card);
+
+   return 0;
 }
-module_exit(omapabe_soc_exit);
+
+static struct platform_driver omapabe_driver = {
+   .driver = {
+   .name = omap-abe-twl6040,
+   .owner = THIS_MODULE,
+   .pm = snd_soc_pm_ops,
+   },
+   .probe = omapabe_probe,
+   .remove = __devexit_p(omapabe_remove),
+};
+
+module_platform_driver(omapabe_driver);
 
 MODULE_AUTHOR(Misael Lopez Cruz misael.lo...@ti.com);
 MODULE_DESCRIPTION(ALSA SoC for OMAP boards with ABE and twl6040 codec);
 MODULE_LICENSE(GPL);
+MODULE_ALIAS(platform:omap-abe-twl6040);
-- 
1.7.8.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 v3 4/9] ASoC: twl6040: Convert MICBIAS to SUPPLY widget

2011-12-22 Thread Peter Ujfalusi
In order to avoid breakage change the omap-abe-twl6040
machine driver's routing.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c|   16 
 sound/soc/omap/omap-abe-twl6040.c |   14 +++---
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a4a65dc..2be98e8 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1102,14 +1102,14 @@ static const struct snd_soc_dapm_widget 
twl6040_dapm_widgets[] = {
TWL6040_REG_MICRCTL, 2, 0),
 
/* Microphone bias */
-   SND_SOC_DAPM_MICBIAS(Headset Mic Bias,
-   TWL6040_REG_AMICBCTL, 0, 0),
-   SND_SOC_DAPM_MICBIAS(Main Mic Bias,
-   TWL6040_REG_AMICBCTL, 4, 0),
-   SND_SOC_DAPM_MICBIAS(Digital Mic1 Bias,
-   TWL6040_REG_DMICBCTL, 0, 0),
-   SND_SOC_DAPM_MICBIAS(Digital Mic2 Bias,
-   TWL6040_REG_DMICBCTL, 4, 0),
+   SND_SOC_DAPM_SUPPLY(Headset Mic Bias,
+   TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Main Mic Bias,
+   TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Digital Mic1 Bias,
+   TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
+   SND_SOC_DAPM_SUPPLY(Digital Mic2 Bias,
+   TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
 
/* DACs */
SND_SOC_DAPM_DAC(HSDAC Left, Headset Playback, SND_SOC_NOPM, 0, 0),
diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 4974ea1..18a25b0 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -123,17 +123,17 @@ static const struct snd_soc_dapm_widget 
twl6040_dapm_widgets[] = {
 
 static const struct snd_soc_dapm_route audio_map[] = {
/* External Mics: MAINMIC, SUBMIC with bias*/
-   {MAINMIC, NULL, Main Mic Bias},
-   {SUBMIC, NULL, Main Mic Bias},
-   {Main Mic Bias, NULL, Ext Mic},
+   {MAINMIC, NULL, Ext Mic},
+   {SUBMIC, NULL, Ext Mic},
+   {Ext Mic, NULL, Main Mic Bias},
 
/* External Speakers: HFL, HFR */
{Ext Spk, NULL, HFL},
{Ext Spk, NULL, HFR},
 
/* Headset Mic: HSMIC with bias */
-   {HSMIC, NULL, Headset Mic Bias},
-   {Headset Mic Bias, NULL, Headset Mic},
+   {HSMIC, NULL, Headset Mic},
+   {Headset Mic, NULL, Headset Mic Bias},
 
/* Headset Stereophone (Headphone): HSOL, HSOR */
{Headset Stereophone, NULL, HSOL},
@@ -182,8 +182,8 @@ static const struct snd_soc_dapm_widget dmic_dapm_widgets[] 
= {
 };
 
 static const struct snd_soc_dapm_route dmic_audio_map[] = {
-   {DMic, NULL, Digital Mic1 Bias},
-   {Digital Mic1 Bias, NULL, Digital Mic},
+   {DMic, NULL, Digital Mic},
+   {Digital Mic, NULL, Digital Mic1 Bias},
 };
 
 static int omapabe_dmic_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.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 v3 5/9] ASoC: omap-abe-twl6040: Add complete DAPM routing

2011-12-22 Thread Peter Ujfalusi
SDP4430 is a reference platform, and as such it has all possible
audio routing implemented.
Correct the DAPM routing to be complete.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   46 ++--
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 18a25b0..cf3cb08 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -113,38 +113,48 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
 
 /* SDP4430 machine DAPM */
 static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
-   SND_SOC_DAPM_MIC(Ext Mic, NULL),
-   SND_SOC_DAPM_SPK(Ext Spk, NULL),
-   SND_SOC_DAPM_MIC(Headset Mic, NULL),
+   /* Outputs */
SND_SOC_DAPM_HP(Headset Stereophone, NULL),
SND_SOC_DAPM_SPK(Earphone Spk, NULL),
-   SND_SOC_DAPM_INPUT(FM Stereo In),
+   SND_SOC_DAPM_SPK(Ext Spk, NULL),
+   SND_SOC_DAPM_LINE(Line Out, NULL),
+   SND_SOC_DAPM_SPK(Vibrator, NULL),
+
+   /* Inputs */
+   SND_SOC_DAPM_MIC(Headset Mic, NULL),
+   SND_SOC_DAPM_MIC(Main Handset Mic, NULL),
+   SND_SOC_DAPM_MIC(Sub Handset Mic, NULL),
+   SND_SOC_DAPM_LINE(Line In, NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
-   /* External Mics: MAINMIC, SUBMIC with bias*/
-   {MAINMIC, NULL, Ext Mic},
-   {SUBMIC, NULL, Ext Mic},
-   {Ext Mic, NULL, Main Mic Bias},
+   /* Routings for outputs */
+   {Headset Stereophone, NULL, HSOL},
+   {Headset Stereophone, NULL, HSOR},
+
+   {Earphone Spk, NULL, EP},
 
-   /* External Speakers: HFL, HFR */
{Ext Spk, NULL, HFL},
{Ext Spk, NULL, HFR},
 
-   /* Headset Mic: HSMIC with bias */
+   {Line Out, NULL, AUXL},
+   {Line Out, NULL, AUXR},
+
+   {Vibrator, NULL, VIBRAL},
+   {Vibrator, NULL, VIBRAR},
+
+   /* Routings for inputs */
{HSMIC, NULL, Headset Mic},
{Headset Mic, NULL, Headset Mic Bias},
 
-   /* Headset Stereophone (Headphone): HSOL, HSOR */
-   {Headset Stereophone, NULL, HSOL},
-   {Headset Stereophone, NULL, HSOR},
+   {MAINMIC, NULL, Main Handset Mic},
+   {Main Handset Mic, NULL, Main Mic Bias},
 
-   /* Earphone speaker */
-   {Earphone Spk, NULL, EP},
+   {SUBMIC, NULL, Sub Handset Mic},
+   {Sub Handset Mic, NULL, Main Mic Bias},
 
-   /* Aux/FM Stereo In: AFML, AFMR */
-   {AFML, NULL, FM Stereo In},
-   {AFMR, NULL, FM Stereo In},
+   {AFML, NULL, Line In},
+   {AFMR, NULL, Line In},
 };
 
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
-- 
1.7.8.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 v3 6/9] ASoC: omap-abe-twl6040: DAI link selection based on platform data

2011-12-22 Thread Peter Ujfalusi
We can have machines without DMIC connected. In this case there is
no need to create amother (unusable) capture PCM on the card.
The existence of the DMIC connection can be checked via
pdata-has_dmic.
Select the correct dai_link structure for the card based on
pdata-has_dmic.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   26 ++
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index cf3cb08..9e6e4c2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -212,7 +212,7 @@ static int omapabe_dmic_init(struct snd_soc_pcm_runtime 
*rtd)
 }
 
 /* Digital audio interface glue - connects codec -- CPU */
-static struct snd_soc_dai_link sdp4430_dai[] = {
+static struct snd_soc_dai_link twl6040_dmic_dai[] = {
{
.name = TWL6040,
.stream_name = TWL6040,
@@ -235,11 +235,21 @@ static struct snd_soc_dai_link sdp4430_dai[] = {
},
 };
 
+static struct snd_soc_dai_link twl6040_only_dai[] = {
+   {
+   .name = TWL6040,
+   .stream_name = TWL6040,
+   .cpu_dai_name = omap-mcpdm,
+   .codec_dai_name = twl6040-legacy,
+   .platform_name = omap-pcm-audio,
+   .codec_name = twl6040-codec,
+   .init = omapabe_twl6040_init,
+   .ops = omapabe_ops,
+   },
+};
+
 /* Audio machine driver */
 static struct snd_soc_card omapabe_card = {
-   .dai_link = sdp4430_dai,
-   .num_links = ARRAY_SIZE(sdp4430_dai),
-
.dapm_widgets = twl6040_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(twl6040_dapm_widgets),
.dapm_routes = audio_map,
@@ -266,6 +276,14 @@ static __devinit int omapabe_probe(struct platform_device 
*pdev)
return -ENODEV;
}
 
+   if (pdata-has_dmic) {
+   card-dai_link = twl6040_dmic_dai;
+   card-num_links = ARRAY_SIZE(twl6040_dmic_dai);
+   } else {
+   card-dai_link = twl6040_only_dai;
+   card-num_links = ARRAY_SIZE(twl6040_only_dai);
+   }
+
ret = snd_soc_register_card(card);
if (ret)
dev_err(pdev-dev, snd_soc_register_card() failed: %d\n,
-- 
1.7.8.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 v3 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Peter Ujfalusi
PandaBoard has twl6040 codec for audio.
Register the omap4-abe-twl6040 platform device.
Add platform data to enable the twl6040 codec.
Since there is a difference in audio between  PandaBoard 4430
and PandaBoard ES (4460):
Use different name for the sound card:
OMAP4-Panda for PandaBoard 4430
OMAP4-PandaES for PandaBoard ES

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Santosh Shilimkar santosh.shilim...@ti.com
CC: David Anders x0132...@ti.com
---
 arch/arm/mach-omap2/board-omap4panda.c |   57 +++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c 
b/arch/arm/mach-omap2/board-omap4panda.c
index b6f1144..8963dfe 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -28,6 +28,7 @@
 #include linux/regulator/machine.h
 #include linux/regulator/fixed.h
 #include linux/wl12xx.h
+#include linux/platform_data/omap-abe-twl6040.h
 
 #include mach/hardware.h
 #include asm/hardware/gic.h
@@ -90,9 +91,31 @@ static struct platform_device leds_gpio = {
},
 };
 
+static struct omap_abe_twl6040_data panda_abe_audio_data = {
+   /* Audio out */
+   .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* HandsFree through expasion connector */
+   .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* PandaBoard: FM TX, PandaBoardES: can be connected to audio out */
+   .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* PandaBoard: FM RX, PandaBoardES: audio in */
+   .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+   /* No jack detection. */
+   .jack_detection = 0,
+};
+
+static struct platform_device panda_abe_audio = {
+   .name   = omap-abe-twl6040,
+   .id = -1,
+   .dev = {
+   .platform_data = panda_abe_audio_data,
+   },
+};
+
 static struct platform_device *panda_devices[] __initdata = {
leds_gpio,
wl1271_device,
+   panda_abe_audio,
 };
 
 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
@@ -251,8 +274,25 @@ static int __init omap4_twl6030_hsmmc_init(struct 
omap2_hsmmc_info *controllers)
return 0;
 }
 
+static struct twl4030_codec_data twl6040_codec = {
+   /* single-step ramp for headset and handsfree */
+   .hs_left_step   = 0x0f,
+   .hs_right_step  = 0x0f,
+   .hf_left_step   = 0x1d,
+   .hf_right_step  = 0x1d,
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+   .codec  = twl6040_codec,
+   .audpwron_gpio  = 127,
+   .naudint_irq= OMAP44XX_IRQ_SYS_2N,
+   .irq_base   = TWL6040_CODEC_IRQ_BASE,
+};
+
 /* Panda board uses the common PMIC configuration */
-static struct twl4030_platform_data omap4_panda_twldata;
+static struct twl4030_platform_data omap4_panda_twldata = {
+   .audio  = twl6040_audio,
+};
 
 /*
  * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -548,6 +588,20 @@ void omap4_panda_display_init(void)
omap_display_init(omap4_panda_dss_data);
 }
 
+static void omap4_panda_init_rev(void)
+{
+   if (cpu_is_omap4430()) {
+   /* PandaBoard 4430 */
+   /* ASoC audio configuration */
+   panda_abe_audio_data.card_name = PandaBoard;
+   panda_abe_audio_data.has_hsmic = 1;
+   } else {
+   /* PandaBoard ES */
+   /* ASoC audio configuration */
+   panda_abe_audio_data.card_name = PandaBoardES;
+   }
+}
+
 static void __init omap4_panda_init(void)
 {
int package = OMAP_PACKAGE_CBS;
@@ -559,6 +613,7 @@ static void __init omap4_panda_init(void)
if (wl12xx_set_platform_data(omap_panda_wlan_data))
pr_err(error setting wl12xx data\n);
 
+   omap4_panda_init_rev();
omap4_panda_i2c_init();
platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
platform_device_register(omap_vwlan_device);
-- 
1.7.8.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 v3 9/9] ASoC: Kconfig: OMAP4: Enable support for PandaBoards

2011-12-22 Thread Peter Ujfalusi
Enable ASoC audio support for OMAP4 based machines with
twl6040 codec via the omap-abe-twl6040 machine driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/Kconfig |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 98410b8..47b23fe 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -99,7 +99,7 @@ config SND_OMAP_SOC_SDP3430
 
 config SND_OMAP_SOC_OMAP_ABE_TWL6040
tristate SoC Audio support for OMAP boards using ABE and twl6040 codec
-   depends on TWL4030_CORE  SND_OMAP_SOC  MACH_OMAP_4430SDP
+   depends on TWL4030_CORE  SND_OMAP_SOC  ARCH_OMAP4
select SND_OMAP_SOC_DMIC
select SND_OMAP_SOC_MCPDM
select SND_SOC_TWL6040
@@ -108,6 +108,8 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
  Say Y if you want to add support for SoC audio on OMAP boards using
  ABE and twl6040 codec. This driver currently supports:
  - SDP4430/Blaze boards
+ - PandaBoard (4430)
+ - PandaBoardES (4460)
 
 config SND_OMAP_SOC_OMAP4_HDMI
tristate SoC Audio support for Texas Instruments OMAP4 HDMI
-- 
1.7.8.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 v3 7/9] ASoC: omap-abe-twl6040: Configure card according to platform data

2011-12-22 Thread Peter Ujfalusi
Disable the not connected pins on the board based on the
received platform data.
DO not register the jack function on boards, which does not have
means to detect it (jack is always connected).

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/omap/omap-abe-twl6040.c |   44 ++--
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c 
b/sound/soc/omap/omap-abe-twl6040.c
index 9e6e4c2..3627bf2 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -157,10 +157,32 @@ static const struct snd_soc_dapm_route audio_map[] = {
{AFMR, NULL, Line In},
 };
 
+static inline void twl6040_disconnect_pin(struct snd_soc_dapm_context *dapm,
+ int connected, char *pin)
+{
+   if (!connected)
+   snd_soc_dapm_disable_pin(dapm, pin);
+}
+
 static int omapabe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 {
struct snd_soc_codec *codec = rtd-codec;
-   int ret, hs_trim;
+   struct snd_soc_card *card = codec-card;
+   struct snd_soc_dapm_context *dapm = codec-dapm;
+   struct omap_abe_twl6040_data *pdata = dev_get_platdata(card-dev);
+   int hs_trim;
+   int ret = 0;
+
+   /* Disable not connected paths if not used */
+   twl6040_disconnect_pin(dapm, pdata-has_hs, Headset Stereophone);
+   twl6040_disconnect_pin(dapm, pdata-has_hf, Ext Spk);
+   twl6040_disconnect_pin(dapm, pdata-has_ep, Earphone Spk);
+   twl6040_disconnect_pin(dapm, pdata-has_aux, Line Out);
+   twl6040_disconnect_pin(dapm, pdata-has_vibra, Vinrator);
+   twl6040_disconnect_pin(dapm, pdata-has_hsmic, Headset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_mainmic, Main Handset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_submic, Sub Handset Mic);
+   twl6040_disconnect_pin(dapm, pdata-has_afm, Line In);
 
/*
 * Configure McPDM offset cancellation based on the HSOTRIM value from
@@ -170,19 +192,17 @@ static int omapabe_twl6040_init(struct 
snd_soc_pcm_runtime *rtd)
omap_mcpdm_configure_dn_offsets(rtd, TWL6040_HSF_TRIM_LEFT(hs_trim),
TWL6040_HSF_TRIM_RIGHT(hs_trim));
 
-   /* Headset jack detection */
-   ret = snd_soc_jack_new(codec, Headset Jack,
-   SND_JACK_HEADSET, hs_jack);
-   if (ret)
-   return ret;
-
-   ret = snd_soc_jack_add_pins(hs_jack, ARRAY_SIZE(hs_jack_pins),
-   hs_jack_pins);
+   /* Headset jack detection only if it is supported */
+   if (pdata-jack_detection) {
+   ret = snd_soc_jack_new(codec, Headset Jack,
+   SND_JACK_HEADSET, hs_jack);
+   if (ret)
+   return ret;
 
-   if (machine_is_omap_4430sdp())
+   ret = snd_soc_jack_add_pins(hs_jack, ARRAY_SIZE(hs_jack_pins),
+   hs_jack_pins);
twl6040_hs_jack_detect(codec, hs_jack, SND_JACK_HEADSET);
-   else
-   snd_soc_jack_report(hs_jack, SND_JACK_HEADSET, 
SND_JACK_HEADSET);
+   }
 
return ret;
 }
-- 
1.7.8.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 v3 2/9] OMAP4: 4430sdp: Register platform device for OMAP4 audio

2011-12-22 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [111222 11:03]:
 To avoid breakage in audio support with the coming change
 in ASoC machine driver (conversion to platfrom device).
 
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 CC: Santosh Shilimkar santosh.shilim...@ti.com

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

 ---
  arch/arm/mach-omap2/board-4430sdp.c |   27 +++
  1 files changed, 27 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
 b/arch/arm/mach-omap2/board-4430sdp.c
 index 21b62bd..394cbab 100644
 --- a/arch/arm/mach-omap2/board-4430sdp.c
 +++ b/arch/arm/mach-omap2/board-4430sdp.c
 @@ -41,6 +41,7 @@
  #include video/omap-panel-nokia-dsi.h
  #include video/omap-panel-picodlp.h
  #include linux/wl12xx.h
 +#include linux/platform_data/omap-abe-twl6040.h
  
  #include mux.h
  #include hsmmc.h
 @@ -377,12 +378,38 @@ static struct platform_device sdp4430_dmic_codec = {
   .id = -1,
  };
  
 +static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
 + .card_name = SDP4430,
 + .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
 + .has_hf = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
 + .has_ep = 1,
 + .has_aux= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
 + .has_vibra  = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
 +
 + .has_dmic   = 1,
 + .has_hsmic  = 1,
 + .has_mainmic= 1,
 + .has_submic = 1,
 + .has_afm= ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
 +
 + .jack_detection = 1,
 +};
 +
 +static struct platform_device sdp4430_abe_audio = {
 + .name   = omap-abe-twl6040,
 + .id = -1,
 + .dev = {
 + .platform_data = sdp4430_abe_audio_data,
 + },
 +};
 +
  static struct platform_device *sdp4430_devices[] __initdata = {
   sdp4430_gpio_keys_device,
   sdp4430_leds_gpio,
   sdp4430_leds_pwm,
   sdp4430_vbat,
   sdp4430_dmic_codec,
 + sdp4430_abe_audio,
  };
  
  static struct omap_musb_board_data musb_board_data = {
 -- 
 1.7.8.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] ARM: OMAP: hsmmc: add max_freq field

2011-12-22 Thread Kishore Kadiyala
On Wed, Dec 14, 2011 at 6:52 PM, Daniel Mack zon...@gmail.com wrote:
 External circuitry like level shifters may limit the maximum operation
 speed of the hsmmc controller. Add a field to struct omap2_hsmmc_info
 so boards can adjust the setting on demand.

 Signed-off-by: Daniel Mack zon...@gmail.com
 Cc: Tony Lindgren t...@atomide.com
 ---
  arch/arm/mach-omap2/hsmmc.c   |    1 +
  arch/arm/mach-omap2/hsmmc.h   |    2 ++
  drivers/mmc/host/omap_hsmmc.c |    8 ++--
  3 files changed, 9 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
 index f4a1020..4c7bc36 100644
 --- a/arch/arm/mach-omap2/hsmmc.c
 +++ b/arch/arm/mach-omap2/hsmmc.c
 @@ -298,6 +298,7 @@ static int __init omap_hsmmc_pdata_init(struct 
 omap2_hsmmc_info *c,
        mmc-slots[0].caps = c-caps;
        mmc-slots[0].internal_clock = !c-ext_clock;
        mmc-dma_mask = 0x;
 +       mmc-max_freq = c-max_freq;
        if (cpu_is_omap44xx())
                mmc-reg_offset = OMAP4_MMC_REG_OFFSET;
        else
 diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
 index f757e78..65a8c12 100644
 --- a/arch/arm/mach-omap2/hsmmc.h
 +++ b/arch/arm/mach-omap2/hsmmc.h
 @@ -25,6 +25,8 @@ struct omap2_hsmmc_info {
        char    *name;          /* or NULL for default */
        struct device *dev;     /* returned: pointer to mmc adapter */
        int     ocr_mask;       /* temporary HACK */
 +       int     max_freq;       /* maximum clock, if constrained by external
 +                                * circuitry, or 0 for default */
        /* Remux (pad configuration) when powering on/off */
        void (*remux)(struct device *dev, int slot, int power_on);
        /* init some special card */
 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index 101cd31..8215ef9 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -1927,8 +1927,12 @@ static int __init omap_hsmmc_probe(struct 
 platform_device *pdev)
        if (mmc_slot(host).vcc_aux_disable_is_sleep)
                mmc_slot(host).no_off = 1;

 -       mmc-f_min      = OMAP_MMC_MIN_CLOCK;
 -       mmc-f_max      = OMAP_MMC_MAX_CLOCK;
 +       mmc-f_min = OMAP_MMC_MIN_CLOCK;
 +
 +       if (pdata-max_freq  0)

What about having check as below:
if (pdata-max_freq  0  pdata-max_freq  OMAP_MMC_MAX_CLOCK)

 +               mmc-f_max = pdata-max_freq;
 +       else
 +               mmc-f_max = OMAP_MMC_MAX_CLOCK;

        spin_lock_init(host-irq_lock);

 --
 1.7.7.4

 --
 To unsubscribe from this list: send the line unsubscribe linux-mmc in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.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 v3 8/9] OMAP4: omap4panda: Enable audio support

2011-12-22 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [111222 11:03]:
 PandaBoard has twl6040 codec for audio.
 Register the omap4-abe-twl6040 platform device.
 Add platform data to enable the twl6040 codec.
 Since there is a difference in audio between  PandaBoard 4430
 and PandaBoard ES (4460):
 Use different name for the sound card:
 OMAP4-Panda for PandaBoard 4430
 OMAP4-PandaES for PandaBoard ES
 
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 CC: Santosh Shilimkar santosh.shilim...@ti.com
 CC: David Anders x0132...@ti.com

Acked-by: Tony Lindgren t...@atomide.com
--
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


  1   2   >