Re: [PATCH v2 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-20 Thread Dmitry Torokhov
On Mon, Jul 20, 2015 at 10:20:13AM +0530, Vignesh R wrote:
 On am437x-gp-evm, pixcir touchscreen can wake the system from low power
 state by generating wake-up interrupt via pinctrl and IO daisy chain.
 Add support for optional wakeup interrupt source by regsitering to
 automated wake IRQ framework introduced by commit 4990d4fe327b (PM /
 Wakeirq: Add automated device wake IRQ handling).
 This is similar in approach to commit 2a0b965cfb6e (serial: omap: Add
 support for optional wake-up)
 
 Signed-off-by: Vignesh R vigne...@ti.com
 ---
 v2:
  * use of_irq_get_byname()
  * remove enable/disable_wake_irq()
 
  drivers/input/touchscreen/pixcir_i2c_ts.c | 17 +
  include/linux/input/pixcir_ts.h   |  1 +
  2 files changed, 14 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c 
 b/drivers/input/touchscreen/pixcir_i2c_ts.c
 index 8f3e243a62bf..b9cebf274678 100644
 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
 +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
 @@ -29,6 +29,8 @@
  #include linux/of.h
  #include linux/of_gpio.h
  #include linux/of_device.h
 +#include linux/of_irq.h
 +#include linux/pm_wakeirq.h
  
  #define PIXCIR_MAX_SLOTS   5 /* Max fingers supported by driver */
  
 @@ -364,8 +366,6 @@ static int __maybe_unused pixcir_i2c_ts_suspend(struct 
 device *dev)
   goto unlock;
   }
   }
 -
 - enable_irq_wake(client-irq);
   } else if (input-users) {
   ret = pixcir_stop(ts);
   }
 @@ -386,8 +386,6 @@ static int __maybe_unused pixcir_i2c_ts_resume(struct 
 device *dev)
   mutex_lock(input-mutex);
  
   if (device_may_wakeup(client-dev)) {
 - disable_irq_wake(client-irq);
 -
   if (!input-users) {
   ret = pixcir_stop(ts);
   if (ret) {
 @@ -445,6 +443,8 @@ static struct pixcir_ts_platform_data 
 *pixcir_parse_dt(struct device *dev)
   dev_dbg(dev, %s: x %d, y %d, gpio %d\n, __func__,
   pdata-x_max + 1, pdata-y_max + 1, pdata-gpio_attb);
  
 + pdata-wakeirq = of_irq_get_byname(dev-of_node, wakeupirq);
 +
   return pdata;
  }
  #else
 @@ -564,11 +564,20 @@ static int pixcir_i2c_ts_probe(struct i2c_client 
 *client,
   i2c_set_clientdata(client, tsdata);
   device_init_wakeup(client-dev, 1);
  
 + /* Register wakeirq */
 + error = pdata-wakeirq ?

Hmm, I guess the condition should be pdata-wakeirq  0.

 + dev_pm_set_dedicated_wake_irq(dev, pdata-wakeirq) :
 + dev_pm_set_wake_irq(dev, client-irq);
 + if (error)
 + dev_info(dev, unable to get wakeirq %d\n,
 +  error);
 +
   return 0;
  }
  
  static int pixcir_i2c_ts_remove(struct i2c_client *client)
  {
 + dev_pm_clear_wake_irq(client-dev);
   device_init_wakeup(client-dev, 0);
  
   return 0;
 diff --git a/include/linux/input/pixcir_ts.h b/include/linux/input/pixcir_ts.h
 index 7bae83b7c396..da573de5a5ee 100644
 --- a/include/linux/input/pixcir_ts.h
 +++ b/include/linux/input/pixcir_ts.h
 @@ -58,6 +58,7 @@ struct pixcir_ts_platform_data {
   int x_max;
   int y_max;
   int gpio_attb;  /* GPIO connected to ATTB line */
 + int wakeirq;
   struct pixcir_i2c_chip_data chip;
  };
  
 -- 
 2.4.5
 

-- 
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/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-20 Thread Dmitry Torokhov
On Sun, Jul 19, 2015 at 11:09:30PM -0700, Tony Lindgren wrote:
 * Vignesh R vigne...@ti.com [150719 21:53]:
  @@ -445,6 +443,8 @@ static struct pixcir_ts_platform_data 
  *pixcir_parse_dt(struct device *dev)
  dev_dbg(dev, %s: x %d, y %d, gpio %d\n, __func__,
  pdata-x_max + 1, pdata-y_max + 1, pdata-gpio_attb);
   
  +   pdata-wakeirq = of_irq_get_byname(dev-of_node, wakeupirq);
  +
  return pdata;
 
 What about handling -EPROVE_DEFER here? At least pinctrl-single can be
 be a loadable module for the dedicated wakeirqs.

Right. I think we should only allow -ENODATA to continue and return
error in all other cases.

Also, I think irq suffix on name is redundant.

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 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-20 Thread Dmitry Torokhov
On Sun, Jul 19, 2015 at 11:05:07PM -0700, Tony Lindgren wrote:
 * Vignesh R vigne...@ti.com [150719 21:51]:
  On 7/18/2015 3:21 AM, Dmitry Torokhov wrote:
   
   I wonder if driver core should be responsible for clearing wake irq and
   also for clearing wakeup flag.
   
  
  AFAICU, wakeup flag is deleted when struct device is deleted, hence,
  device_init_wakeup() call may not be required in .remove(). But,
  dev_pm_clear_wake_irq() can be moved to driver core.
 
 Currently the lifecycle of struct wakeup_source is not necessarily
 the same as the lifecycle struct device. I believe net and usb drivers
 at least allocate it dynamically.

I am not sure if I follow. I was wondering if we should clear the wakeup
IRQ setting on the driver unbinding. It does not mean that we'd be
deleting wakeup_source, just that we'll clear wakeup irq setting from
it.

-- 
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/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-20 Thread Tony Lindgren
* Vignesh R vigne...@ti.com [150719 21:53]:
 @@ -445,6 +443,8 @@ static struct pixcir_ts_platform_data 
 *pixcir_parse_dt(struct device *dev)
   dev_dbg(dev, %s: x %d, y %d, gpio %d\n, __func__,
   pdata-x_max + 1, pdata-y_max + 1, pdata-gpio_attb);
  
 + pdata-wakeirq = of_irq_get_byname(dev-of_node, wakeupirq);
 +
   return pdata;

What about handling -EPROVE_DEFER here? At least pinctrl-single can be
be a loadable module for the dedicated wakeirqs.

Regarads,

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 3/3] soc: ti: Add wkup_m3_ipc driver

2015-07-20 Thread Tony Lindgren
* Dave Gerlach d-gerl...@ti.com [150717 13:59]:
 +
 +/* Public functions */
...
 +EXPORT_SYMBOL_GPL(wkup_m3_set_mem_type);
 +EXPORT_SYMBOL_GPL(wkup_m3_set_resume_address);
 +EXPORT_SYMBOL_GPL(wkup_m3_request_pm_status);
 +EXPORT_SYMBOL_GPL(wkup_m3_prepare_low_power);
 +EXPORT_SYMBOL_GPL(wkup_m3_finish_low_power);

I think you can avoid exporting these SoC specific functions
by just exporting wkup_m3_request() and wkup_m3_free() type
functions with a data structure containing the necessary
function pointers.

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 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-20 Thread Tony Lindgren
* Vignesh R vigne...@ti.com [150719 21:51]:
 On 7/18/2015 3:21 AM, Dmitry Torokhov wrote:
  
  I wonder if driver core should be responsible for clearing wake irq and
  also for clearing wakeup flag.
  
 
 AFAICU, wakeup flag is deleted when struct device is deleted, hence,
 device_init_wakeup() call may not be required in .remove(). But,
 dev_pm_clear_wake_irq() can be moved to driver core.

Currently the lifecycle of struct wakeup_source is not necessarily
the same as the lifecycle struct device. I believe net and usb drivers
at least allocate it dynamically.

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


twl6030-gpadc support for twl6037

2015-07-20 Thread Belisko Marek
Hi all,

I'm trying to figure out what is relation between palmas mfd driver
and twl-core for twl603x devices.
twl-core driver seems to be older than palmas driver but seems both
export same functionality (except that palmas have defined structs for
gpadc but functionality is missing). My main focus is to add support
for twl6037 to gpadc iio driver in iio/adc/twl6030-gpadc which is
using twl-core for twl6030 and twl6032. Adding twl6037 support should
be straightforward but dts file used in omap5-uevm using palmas driver
and not twl6030. So it's completely confusing to me how to proceed or
which direction is correct. Seems I'm missing some parts of puzzle ;)
Thanks for any hints.

BR,

marek

-- 
as simple and primitive as possible
-
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.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 1/2] input: touchscreen: pixcir_i2c_ts: Add support for optional wakeup interrupt

2015-07-20 Thread Tony Lindgren
* Dmitry Torokhov dmitry.torok...@gmail.com [150719 23:36]:
 On Sun, Jul 19, 2015 at 11:05:07PM -0700, Tony Lindgren wrote:
  * Vignesh R vigne...@ti.com [150719 21:51]:
   On 7/18/2015 3:21 AM, Dmitry Torokhov wrote:

I wonder if driver core should be responsible for clearing wake irq and
also for clearing wakeup flag.

   
   AFAICU, wakeup flag is deleted when struct device is deleted, hence,
   device_init_wakeup() call may not be required in .remove(). But,
   dev_pm_clear_wake_irq() can be moved to driver core.
  
  Currently the lifecycle of struct wakeup_source is not necessarily
  the same as the lifecycle struct device. I believe net and usb drivers
  at least allocate it dynamically.
 
 I am not sure if I follow. I was wondering if we should clear the wakeup
 IRQ setting on the driver unbinding. It does not mean that we'd be
 deleting wakeup_source, just that we'll clear wakeup irq setting from
 it.

Yes you're right we can do that. I was mostly commenting on why we
currently can't automate things further with devm.

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 v3 2/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY

2015-07-20 Thread Tero Kristo

On 07/17/2015 04:47 PM, Roger Quadros wrote:

This register is required to be passed to the SATA PHY driver
to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).

Signed-off-by: Roger Quadros rog...@ti.com
---
  arch/arm/boot/dts/dra7.dtsi | 1 +
  1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 8f1e25b..4a0718c 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1140,6 +1140,7 @@
ctrl-module = omap_control_sata;
clocks = sys_clkin1, sata_ref_clk;
clock-names = sysclk, refclk;
+   syscon-pllreset = scm_conf 0x3fc;
#phy-cells = 0;
};




Looks fine to me.

Make sure you use this register via regmap_update_bits only, seeing 
there is another potential user for the same register.


-Tero
--
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] ARM: dts: am437x: add aliases for all UART instances

2015-07-20 Thread Sekhar Nori
Add serialN aliases for all 6 UART instances on
the AM437x SoC so each board's .dts file does not
have to define its own aliases.

Remove the alias added for am437x-gp-evm.dts now
that we have the aliases defined in am4372.dtsi
file.

Signed-off-by: Sekhar Nori nsek...@ti.com
---
 arch/arm/boot/dts/am4372.dtsi   | 5 +
 arch/arm/boot/dts/am437x-gp-evm.dts | 1 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index ade28c790f4b..7eb43a4f6176 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -23,6 +23,11 @@
i2c1 = i2c1;
i2c2 = i2c2;
serial0 = uart0;
+   serial1 = uart1;
+   serial2 = uart2;
+   serial3 = uart3;
+   serial4 = uart4;
+   serial5 = uart5;
ethernet0 = cpsw_emac0;
ethernet1 = cpsw_emac1;
};
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts 
b/arch/arm/boot/dts/am437x-gp-evm.dts
index 84aa30c3235a..f435dc9b44ca 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -21,7 +21,6 @@
 
aliases {
display0 = lcd0;
-   serial3 = uart3;
};
 
vmmcsd_fixed: fixedregulator-sd {
-- 
2.4.4.408.g16da57c

--
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 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes

2015-07-20 Thread Tero Kristo

On 07/17/2015 04:47 PM, Roger Quadros wrote:

scm_conf1 maps the control register address space after the
padconf till the end.

Fix the scm_conf and pmx_core resource lengths. We need to add
4 bytes to include the last 32-bit register space.

Remove the redundant dra7_ctrl_core and dra7_ctrl_general nodes.
They are not used by anyone and no longer needed as they are
covered by scm_conf and scm_conf1.


Looks like you are doing three things in this patch, maybe split it up 
as such?




Signed-off-by: Roger Quadros rog...@ti.com
---
  arch/arm/boot/dts/dra7.dtsi | 19 ---
  1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 4a0718c..d07c34c 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -141,7 +141,7 @@
dra7_pmx_core: pinmux@1400 {
compatible = ti,dra7-padconf,
 pinctrl-single;
-   reg = 0x1400 0x0464;
+   reg = 0x1400 0x0468;
#address-cells = 1;
#size-cells = 0;
#interrupt-cells = 1;
@@ -149,6 +149,13 @@
pinctrl-single,register-width = 32;
pinctrl-single,function-mask = 
0x3fff;
};
+
+   scm_conf1: scm_conf@1 {


Should be ... scm_conf@1868?

Are there any users for this area anyway? I don't think we should map 
this area just for fun of it. Mostly it looks like this contains efuse 
values for OPPs, which should be mapped from the OPP layer, not as a 
generic syscon.



+   compatible = syscon;
+   reg = 0x1868 0x03e0;
+   #address-cells = 1;
+   #size-cells = 1;
+   };
};

cm_core_aon: cm_core_aon@5000 {
@@ -286,16 +293,6 @@
#thermal-sensor-cells = 1;
};

-   dra7_ctrl_core: ctrl_core@4a002000 {
-   compatible = syscon;
-   reg = 0x4a002000 0x6d0;
-   };
-
-   dra7_ctrl_general: tisyscon@4a002e00 {
-   compatible = syscon;
-   reg = 0x4a002e00 0x7c;
-   };


I thought I had removed these already and yes... this was done in commit 
d919501feffa8715147582c3ffce96fad0c7016f already, but seems they were 
added back in a resolution for a merge conflict later.


-Tero


-
sdma: dma-controller@4a056000 {
compatible = ti,omap4430-sdma;
reg = 0x4a056000 0x1000;



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


Re: [PATCH 1/1 linux-next] mmc: omap: use for_each_sg() for scatterlist parsing

2015-07-20 Thread Ulf Hansson
On 16 June 2015 at 21:15, Fabian Frederick f...@skynet.be wrote:
 See Documentation/DMA-API.txt - Part Id

 Signed-off-by: Fabian Frederick f...@skynet.be

Thanks, applied!

Kind regards
Uffe

 ---
 This is untested.

  drivers/mmc/host/omap.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

 diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
 index 68dd6c7..70dcf07 100644
 --- a/drivers/mmc/host/omap.c
 +++ b/drivers/mmc/host/omap.c
 @@ -948,6 +948,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct 
 mmc_request *req)
  {
 struct mmc_data *data = req-data;
 int i, use_dma = 1, block_size;
 +   struct scatterlist *sg;
 unsigned sg_len;

 host-data = data;
 @@ -972,8 +973,8 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct 
 mmc_request *req)
 sg_len = (data-blocks == 1) ? 1 : data-sg_len;

 /* Only do DMA for entire blocks */
 -   for (i = 0; i  sg_len; i++) {
 -   if ((data-sg[i].length % block_size) != 0) {
 +   for_each_sg(data-sg, sg, sg_len, i) {
 +   if ((sg-length % block_size) != 0) {
 use_dma = 0;
 break;
 }
 --
 2.4.2

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


Re: [PATCH 0/3] omap_hsmmc: Fix card enumeration failure on

2015-07-20 Thread Ulf Hansson
On 16 June 2015 at 12:37, Vignesh R vigne...@ti.com wrote:

 Hi,

 When using omap_hsmmc driver, if sd-card repeatedly plug unplugged
 multiple times quickly, card enumeration stops after few iterations.
 This can be easily reproduced on DRA74X EVM which uses omap_hsmmc driver.
 This patch series addresses the above problem. The first patch fixes irq
 handler to report all DTOs to mmc-core. Second patch adds handling for
 BADA, DEB and CEB interrupts. The last patch introduces driver specific
 card detect irq handler to cleanup pending requests before card removal.

 Tested on DRA74X amd DRA72X and AM437X-GP EVMs, by repeated intense
 plug/unplug iterations.


 Kishon Vijay Abraham I (1):
   mmc: host: omap_hsmmc: Fix DTO and DCRC handling

 Vignesh R (2):
   mmc: host: omap_hsmmc: Handle BADA, DEB and CEB interrupts
   mmc: host: omap_hsmmc: Add custom card detect irq handler

  drivers/mmc/host/omap_hsmmc.c | 84 ---
  1 file changed, 78 insertions(+), 6 deletions(-)

 --
 2.4.1


I have applied patch1 and patch 2 for fixes. Regarding patch 3, let's
give Andreas some more time to comment.

Thanks and sorry for the delay!

Kind regards
Uffe
--
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 01/46] usb: gadget: encapsulate endpoint claiming mechanism

2015-07-20 Thread Krzysztof Opasiak



On 07/15/2015 08:31 AM, Robert Baldyga wrote:

So far it was necessary for usb functions to set ep-driver_data in
endpoint obtained from autoconfig to non-null value, to indicate that
endpoint is claimed by function (in autoconfig it was checked if endpoint
has set this field to non-null value, and if it has, it was assumed that
it is claimed). It could cause bugs becouse if some function doesn't


s/becouse/because

Best regards,
--
Krzysztof Opasiak
Samsung RD Institute Poland
Samsung Electronics
--
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 26/46] usb: gadget: pch_ud: add ep capabilities support

2015-07-20 Thread Krzysztof Opasiak



On 07/15/2015 08:32 AM, Robert Baldyga wrote:

Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga r.bald...@samsung.com
---
  drivers/usb/gadget/udc/pch_udc.c | 14 --
  1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index 613547f..cc8fb3c 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -2895,11 +2895,21 @@ static void pch_udc_pcd_reinit(struct pch_udc_dev *dev)
ep-in = ~i  1;
ep-ep.name = ep_string[i];
ep-ep.ops = pch_udc_ep_ops;
-   if (ep-in)
+   if (ep-in) {
ep-offset_addr = ep-num * UDC_EP_REG_SHIFT;
-   else
+   ep-ep.caps.dir_in = true;
+   } else {
ep-offset_addr = (UDC_EPINT_OUT_SHIFT + ep-num) *
  UDC_EP_REG_SHIFT;
+   ep-ep.caps.dir_out = true;
+   }
+   if (i == UDC_EP0IN_IDX || i == UDC_EP0OUT_IDX) {
+   ep-ep.caps.type_control = true;


In all previous patches you set both dir_in and dir_out to true for ep0 
but in this patch you don't do this. Is there some reason for this or 
it's just a mistake?



+   } else {
+   ep-ep.caps.type_iso = true;
+   ep-ep.caps.type_bulk = true;
+   ep-ep.caps.type_int = true;
+   }
/* need to set ep-ep.maxpacket and set Default Configuration?*/
usb_ep_set_maxpacket_limit(ep-ep, UDC_BULK_MAX_PKT_SIZE);
list_add_tail(ep-ep.ep_list, dev-gadget.ep_list);



Best Regards,

--
Krzysztof Opasiak
Samsung RD Institute Poland
Samsung Electronics
--
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] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam Lee
Hello, here is some more context from the TPS65950's TRM [1].

Quoting from section 15.3.1.2.1 VUSB3V1 section:

VUSB3V1 is also used to bias analog multiplexers on the four MCPC
pins between the carkit and the MADC (supplied by VINTANA2).


And from section 15.4.11. MADC Monitoring Using MCPC:

Four MCPC pins can be selected as analog conversion input pins by
setting the CARKIT_ANA_CTRL[3] SEL_MADC_MCPC bit.

My patch addresses both (set the register, and enable 3v1). And yes it
has been tested on Gumstix Overo COMs (OMAP3 + TPS65950).

Hope to hear from IIO maintainers!

[1] http://www.droid-developers.org/images/2/21/Tps65950_TRM.pdf

On Fri, Jul 17, 2015 at 2:42 AM, Peter Meerwald pme...@pmeerw.net wrote:
 Hello,

 adding linux-iio...

 To get a chance of this patch being considered for inclusion, you
 should send this to the maintainers of the phy and iio framework.
 There is a high chance, that none of them will see your mail.

 On Thu, Jul 16, 2015 at 03:20:27PM -0700, Adam YH Lee wrote:
  MADC[3:6] reads incorrect values without these two following changes:

 uhm MADC[3:6] are externally available analog inputs. Your
 change will result in them being tied to the USB module.

 change regarding TWL4030_USB_SEL_MADC_MCPC is necessary at
 least for some hardware revisions to get proper ADC values

  - enable the 3v1 bias regulator for ADC[3:6]

 The regulator is not required for correct MADC functionality, but
 for correct USB measureing. The regulator should not be requested
 by the madc module, but by the usb module, which is connected to
 the madc.

 in my experience, the MADC exhibits several strange things, I wouldn't be
 surprised that this bias is somehow necessary for operation even if it is
 not what the spec says -- has this been tested?

  - configure ADC[3:6] lines as input, not as USB

 I don't think that should be done for all boards.

  [...]

 -- Sebastian


 --

 Peter Meerwald
 +43-664-218 (mobile)
--
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] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam Lee
Hello Jonathan, I sent the same patch with linux-iio cc'd.
I expanded the cover letter with the quotes from TI's documents, but
the text has been removed in the email somehow.
The discussion in this thread should be enough (I think) for linux-iio
maintainers, so we will see!

Thanks,

Adam

On Mon, Jul 20, 2015 at 10:54 AM, Jonathan Cameron ji...@kernel.org wrote:
 On 20/07/15 18:47, Adam Lee wrote:
 Hello, here is some more context from the TPS65950's TRM [1].

 Quoting from section 15.3.1.2.1 VUSB3V1 section:

 VUSB3V1 is also used to bias analog multiplexers on the four MCPC
 pins between the carkit and the MADC (supplied by VINTANA2).


 And from section 15.4.11. MADC Monitoring Using MCPC:

 Four MCPC pins can be selected as analog conversion input pins by
 setting the CARKIT_ANA_CTRL[3] SEL_MADC_MCPC bit.

 My patch addresses both (set the register, and enable 3v1). And yes it
 has been tested on Gumstix Overo COMs (OMAP3 + TPS65950).

 Hope to hear from IIO maintainers!
 I dug the patch out of the archives.

 Looks clear enough to me.  Could you resend the patch with linux-iio cc'd?
 I will want an Ack from Sebastian.

 Thanks,

 Jonathan


 [1] http://www.droid-developers.org/images/2/21/Tps65950_TRM.pdf

 On Fri, Jul 17, 2015 at 2:42 AM, Peter Meerwald pme...@pmeerw.net wrote:
 Hello,

 adding linux-iio...

 To get a chance of this patch being considered for inclusion, you
 should send this to the maintainers of the phy and iio framework.
 There is a high chance, that none of them will see your mail.

 On Thu, Jul 16, 2015 at 03:20:27PM -0700, Adam YH Lee wrote:
 MADC[3:6] reads incorrect values without these two following changes:

 uhm MADC[3:6] are externally available analog inputs. Your
 change will result in them being tied to the USB module.

 change regarding TWL4030_USB_SEL_MADC_MCPC is necessary at
 least for some hardware revisions to get proper ADC values

 - enable the 3v1 bias regulator for ADC[3:6]

 The regulator is not required for correct MADC functionality, but
 for correct USB measureing. The regulator should not be requested
 by the madc module, but by the usb module, which is connected to
 the madc.

 in my experience, the MADC exhibits several strange things, I wouldn't be
 surprised that this bias is somehow necessary for operation even if it is
 not what the spec says -- has this been tested?

 - configure ADC[3:6] lines as input, not as USB

 I don't think that should be done for all boards.

 [...]

 -- Sebastian


 --

 Peter Meerwald
 +43-664-218 (mobile)
 --
 To unsubscribe from this list: send the line unsubscribe linux-iio 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] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Peter Meerwald
On Mon, 20 Jul 2015, Adam YH Lee wrote:

 MADC[3:6] reads incorrect values without these two following changes:
 
 - enable the 3v1 bias regulator for ADC[3:6]
 - configure ADC[3:6] lines as input, not as USB

comments below
 
 Signed-off-by: Adam YH Lee adam.yh@gmail.com
 ---
  drivers/iio/adc/twl4030-madc.c | 14 ++
  drivers/phy/phy-twl4030-usb.c  |  7 +++
  2 files changed, 21 insertions(+)
 
 diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
 index 94c5f05..b5020ab 100644
 --- a/drivers/iio/adc/twl4030-madc.c
 +++ b/drivers/iio/adc/twl4030-madc.c
 @@ -45,6 +45,7 @@
  #include linux/types.h
  #include linux/gfp.h
  #include linux/err.h
 +#include linux/regulator/consumer.h
  
  #include linux/iio/iio.h
  
 @@ -52,6 +53,7 @@
   * struct twl4030_madc_data - a container for madc info
   * @dev: Pointer to device structure for madc
   * @lock:Mutex protecting this data structure
 + * @regulator:   Pointer to bias regulator for madc
   * @requests:Array of request struct corresponding to SW1, 
 SW2 and RT
   * @use_second_irq:  IRQ selection (main or co-processor)
   * @imr: Interrupt mask register of MADC
 @@ -60,6 +62,7 @@
  struct twl4030_madc_data {
   struct device *dev;
   struct mutex lock;  /* mutex protecting this data structure */
 + struct regulator *usb3v1;
   struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
   bool use_second_irq;
   u8 imr;
 @@ -848,6 +851,14 @@ static int twl4030_madc_probe(struct platform_device 
 *pdev)
   goto err_i2c;
   }
  
 + madc-usb3v1 = devm_regulator_get(madc-dev, vusb3v1);
 + if (IS_ERR(madc-usb3v1))
 + return -ENODEV;
 +
 + ret = regulator_enable(madc-usb3v1);
 + if (ret)
 + dev_err(madc-dev, could not be enable 3v1 bias regulator\n);

please fix wording, could not enable usb 3v1 bias regulator probably

 +
   return 0;
  
  err_i2c:
 @@ -867,6 +878,9 @@ static int twl4030_madc_remove(struct platform_device 
 *pdev)
   twl4030_madc_set_current_generator(madc, 0, 0);
   twl4030_madc_set_power(madc, 0);
  
 + regulator_disable(madc-usb3v1);
 + regulator_put(madc-usb3v1);
 +
   return 0;
  }
  
 diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
 index 7b04bef..88fc7d7 100644
 --- a/drivers/phy/phy-twl4030-usb.c
 +++ b/drivers/phy/phy-twl4030-usb.c
 @@ -144,6 +144,9 @@
  #define PMBR10x0D
  #define GPIO_USB_4PIN_ULPI_2430C (3  0)
  
 +#define TWL4030_USB_SEL_MADC_MCPC(13)
 +#define TWL4030_USB_CARKIT_ANA_CTRL  0xBB
 +
  struct twl4030_usb {
   struct usb_phy  phy;
   struct device   *dev;
 @@ -459,6 +462,10 @@ static int twl4030_phy_power_on(struct phy *phy)
   twl4030_i2c_access(twl, 0);
   schedule_delayed_work(twl-id_workaround_work, 0);
  
 + twl4030_usb_write(twl, TWL4030_USB_CARKIT_ANA_CTRL,
 + twl4030_usb_read(twl, TWL4030_USB_CARKIT_ANA_CTRL) |
 + TWL4030_USB_SEL_MADC_MCPC);
 +

shouldn't this be done is the adc driver?

   return 0;
  }
  
 

-- 

Peter Meerwald
+43-664-218 (mobile)
--
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] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Jonathan Cameron
On 20/07/15 18:47, Adam Lee wrote:
 Hello, here is some more context from the TPS65950's TRM [1].
 
 Quoting from section 15.3.1.2.1 VUSB3V1 section:
 
 VUSB3V1 is also used to bias analog multiplexers on the four MCPC
 pins between the carkit and the MADC (supplied by VINTANA2).
 
 
 And from section 15.4.11. MADC Monitoring Using MCPC:
 
 Four MCPC pins can be selected as analog conversion input pins by
 setting the CARKIT_ANA_CTRL[3] SEL_MADC_MCPC bit.
 
 My patch addresses both (set the register, and enable 3v1). And yes it
 has been tested on Gumstix Overo COMs (OMAP3 + TPS65950).
 
 Hope to hear from IIO maintainers!
I dug the patch out of the archives.

Looks clear enough to me.  Could you resend the patch with linux-iio cc'd?
I will want an Ack from Sebastian.

Thanks,

Jonathan

 
 [1] http://www.droid-developers.org/images/2/21/Tps65950_TRM.pdf
 
 On Fri, Jul 17, 2015 at 2:42 AM, Peter Meerwald pme...@pmeerw.net wrote:
 Hello,

 adding linux-iio...

 To get a chance of this patch being considered for inclusion, you
 should send this to the maintainers of the phy and iio framework.
 There is a high chance, that none of them will see your mail.

 On Thu, Jul 16, 2015 at 03:20:27PM -0700, Adam YH Lee wrote:
 MADC[3:6] reads incorrect values without these two following changes:

 uhm MADC[3:6] are externally available analog inputs. Your
 change will result in them being tied to the USB module.

 change regarding TWL4030_USB_SEL_MADC_MCPC is necessary at
 least for some hardware revisions to get proper ADC values

 - enable the 3v1 bias regulator for ADC[3:6]

 The regulator is not required for correct MADC functionality, but
 for correct USB measureing. The regulator should not be requested
 by the madc module, but by the usb module, which is connected to
 the madc.

 in my experience, the MADC exhibits several strange things, I wouldn't be
 surprised that this bias is somehow necessary for operation even if it is
 not what the spec says -- has this been tested?

 - configure ADC[3:6] lines as input, not as USB

 I don't think that should be done for all boards.

 [...]

 -- Sebastian


 --

 Peter Meerwald
 +43-664-218 (mobile)
 --
 To unsubscribe from this list: send the line unsubscribe linux-iio 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


[PATCH] Fix incomplete initialization of ADC[3:6]$

2015-07-20 Thread Adam YH Lee
Additionally the original discussion for this patch can be found here [5].
$
[1] http://comments.gmane.org/gmane.linux.ports.arm.omap/83698$
[2] 
http://gumstix.8.x6.nabble.com/twl4030-madc-low-read-value-td4967139.html#none$
[3] https://e2e.ti.com/support/power_management/pmu/f/43/t/732$
[4] http://www.droid-developers.org/images/2/21/Tps65950_TRM.pdf$
[5] http://www.spinics.net/lists/linux-omap/msg120300.html

Adam YH Lee (1):
  [TWL4030 MADC] Fix ADC[3:6] readings

 drivers/iio/adc/twl4030-madc.c | 14 ++
 drivers/phy/phy-twl4030-usb.c  |  7 +++
 2 files changed, 21 insertions(+)

-- 
2.1.4

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


[PATCH] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam YH Lee
MADC[3:6] reads incorrect values without these two following changes:

- enable the 3v1 bias regulator for ADC[3:6]
- configure ADC[3:6] lines as input, not as USB

Signed-off-by: Adam YH Lee adam.yh@gmail.com
---
 drivers/iio/adc/twl4030-madc.c | 14 ++
 drivers/phy/phy-twl4030-usb.c  |  7 +++
 2 files changed, 21 insertions(+)

diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 94c5f05..b5020ab 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -45,6 +45,7 @@
 #include linux/types.h
 #include linux/gfp.h
 #include linux/err.h
+#include linux/regulator/consumer.h
 
 #include linux/iio/iio.h
 
@@ -52,6 +53,7 @@
  * struct twl4030_madc_data - a container for madc info
  * @dev:   Pointer to device structure for madc
  * @lock:  Mutex protecting this data structure
+ * @regulator: Pointer to bias regulator for madc
  * @requests:  Array of request struct corresponding to SW1, SW2 and RT
  * @use_second_irq:IRQ selection (main or co-processor)
  * @imr:   Interrupt mask register of MADC
@@ -60,6 +62,7 @@
 struct twl4030_madc_data {
struct device *dev;
struct mutex lock;  /* mutex protecting this data structure */
+   struct regulator *usb3v1;
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
bool use_second_irq;
u8 imr;
@@ -848,6 +851,14 @@ static int twl4030_madc_probe(struct platform_device *pdev)
goto err_i2c;
}
 
+   madc-usb3v1 = devm_regulator_get(madc-dev, vusb3v1);
+   if (IS_ERR(madc-usb3v1))
+   return -ENODEV;
+
+   ret = regulator_enable(madc-usb3v1);
+   if (ret)
+   dev_err(madc-dev, could not be enable 3v1 bias regulator\n);
+
return 0;
 
 err_i2c:
@@ -867,6 +878,9 @@ static int twl4030_madc_remove(struct platform_device *pdev)
twl4030_madc_set_current_generator(madc, 0, 0);
twl4030_madc_set_power(madc, 0);
 
+   regulator_disable(madc-usb3v1);
+   regulator_put(madc-usb3v1);
+
return 0;
 }
 
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 7b04bef..88fc7d7 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -144,6 +144,9 @@
 #define PMBR1  0x0D
 #define GPIO_USB_4PIN_ULPI_2430C   (3  0)
 
+#define TWL4030_USB_SEL_MADC_MCPC  (13)
+#define TWL4030_USB_CARKIT_ANA_CTRL0xBB
+
 struct twl4030_usb {
struct usb_phy  phy;
struct device   *dev;
@@ -459,6 +462,10 @@ static int twl4030_phy_power_on(struct phy *phy)
twl4030_i2c_access(twl, 0);
schedule_delayed_work(twl-id_workaround_work, 0);
 
+   twl4030_usb_write(twl, TWL4030_USB_CARKIT_ANA_CTRL,
+   twl4030_usb_read(twl, TWL4030_USB_CARKIT_ANA_CTRL) |
+   TWL4030_USB_SEL_MADC_MCPC);
+
return 0;
 }
 
-- 
2.1.4

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


Re: [PATCH] irqchip: omap-intc: improve IRQ handler

2015-07-20 Thread Felipe Balbi
On Wed, Jul 15, 2015 at 02:36:54PM +0200, Thomas Gleixner wrote:
 On Wed, 15 Jul 2015, Tony Lindgren wrote:
  Felipe,
  
  * Tony Lindgren t...@atomide.com [150119 13:41]:
   * Felipe Balbi ba...@ti.com [150102 10:50]:
as it turns out the current IRQ number will
*always* be available from SIR register which
renders the reads of PENDING registers as plain
unnecessary overhead.

In order to catch any situation where SIR reads
as zero, we're adding a WARN() to turn it into
a very verbose error and users actually report
it.

With this patch average running time of
omap_intc_handle_irq() reduced from about 28.5us
to 19.8us as measured by the kernel function
profiler.

Tested with BeagleBoneBlack Rev A5C.

Signed-off-by: Felipe Balbi ba...@ti.com
   
   Jason, looks like this is not showing up in Linux next. The
   same for the changes I did for dm81xx.
  
  Can you please resend this to Jason? Looks like this
  is still not merged.
 
 Please send it to me asap and please cc lkml on irqchip patches.

building and testing again. Will resend shortly

-- 
balbi


signature.asc
Description: Digital signature


[PATCH RESEND] irqchip: omap-intc: improve IRQ handler

2015-07-20 Thread Felipe Balbi
as it turns out the current IRQ number will
*always* be available from SIR register which
renders the reads of PENDING registers as plain
unnecessary overhead.

In order to catch any situation where SIR reads
as zero, we're adding a WARN() to turn it into
a very verbose error and users actually report
it.

With this patch average running time of
omap_intc_handle_irq() reduced from about 28.5us
to 19.8us as measured by the kernel function
profiler.

Tested with BeagleBoneBlack Rev A5C.

Tested-by: Tony Lindgren t...@atomide.com
Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/irqchip/irq-omap-intc.c | 35 +--
 1 file changed, 5 insertions(+), 30 deletions(-)

diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index a569c6dbd1d1..0706db624213 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -331,37 +331,12 @@ static int __init omap_init_irq(u32 base, struct 
device_node *node)
 static asmlinkage void __exception_irq_entry
 omap_intc_handle_irq(struct pt_regs *regs)
 {
-   u32 irqnr = 0;
-   int handled_irq = 0;
-   int i;
-
-   do {
-   for (i = 0; i  omap_nr_pending; i++) {
-   irqnr = intc_readl(INTC_PENDING_IRQ0 + (0x20 * i));
-   if (irqnr)
-   goto out;
-   }
-
-out:
-   if (!irqnr)
-   break;
-
-   irqnr = intc_readl(INTC_SIR);
-   irqnr = ACTIVEIRQ_MASK;
+   u32 irqnr;
 
-   if (irqnr) {
-   handle_domain_irq(domain, irqnr, regs);
-   handled_irq = 1;
-   }
-   } while (irqnr);
-
-   /*
-* If an irq is masked or deasserted while active, we will
-* keep ending up here with no irq handled. So remove it from
-* the INTC with an ack.
-*/
-   if (!handled_irq)
-   omap_ack_irq(NULL);
+   irqnr = intc_readl(INTC_SIR);
+   irqnr = ACTIVEIRQ_MASK;
+   WARN(!irqnr, Spurious IRQ ?\n);
+   handle_domain_irq(domain, irqnr, regs);
 }
 
 void __init omap3_init_irq(void)
-- 
2.4.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 RESEND] irqchip: omap-intc: improve IRQ handler

2015-07-20 Thread Thomas Gleixner
On Mon, 20 Jul 2015, Felipe Balbi wrote:
 + irqnr = intc_readl(INTC_SIR);
 + irqnr = ACTIVEIRQ_MASK;
 + WARN(!irqnr, Spurious IRQ ?\n);

Shouldn't that be WARN_ONCE?

Thanks,

tglx
--
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 4.2-rc1 broken Nokia N900

2015-07-20 Thread Michael Welling
On Tue, Jul 14, 2015 at 09:14:12AM +0200, Pali Rohár wrote:
 On Monday 13 July 2015 17:36:07 Michael Welling wrote:
  On Tue, Jul 14, 2015 at 12:02:44AM +0200, Pali Rohár wrote:
   I think nothing special. I just call:
   
   export ARCH=arm
   export CROSS_COMPILE=arm-linux-gnueabi-
   make rx51_defconfig
   rm -f arch/arm/boot/zImage
   make -j12 zImage modules omap3-n900.dtb CONFIG_DEBUG_SECTION_MISMATCH=y
   cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-n900.dtb  
   arch/arm/boot/zImage.new
   mv arch/arm/boot/zImage.new arch/arm/boot/zImage
  
  
  Where are you getting rx51_defconfig from?
  
  This does not appear to be in the kernel source any longer.
  
  Can you try the above with omap2plus_defconfig?
   
 
 It is in my linux-n900 repository: https://github.com/pali/linux-n900
 Repository contains more n900 specific patches but SPI code is unpatched
 
 https://github.com/pali/linux-n900/blob/HEAD/arch/arm/configs/rx51_defconfig
 
 Later in week I can try to compile also with omap2plus_defconfig...
 But in my opinion kernel should not crash with different configuration.

Has any progress been made on this?

Seeing as I was dropped into the middle of this thread,
I took a look at the discussion previous.

It appears that you are building the drivers as modules.
Perhaps I can again attempt to duplicate the issue using modules.
Though this should not make a difference.

 
 -- 
 Pali Rohár
 pali.ro...@gmail.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: linux 4.2-rc1 broken Nokia N900

2015-07-20 Thread Michael Welling
On Wed, Jul 15, 2015 at 09:49:33PM +0200, Pavel Machek wrote:
 Hi!
 
   Ok, so:
   
   4.2-rc1 worked for me, IIRC.
  
  This does not make sense.
  
  Nothing has changed in drivers/spi between these versions.
  Are you sure that 4.2-rc1 worked for you?
 
 Tested again: yes, I have 4.2-rc1 booted on the device... based on
 Linus' 1c4c7159ed2468f3ac4ce5a7f08d79663d381a93 . I can push the
 configs and trees to some public place.
 
   4.2-rc2 oopses a lot.
   
   4.2-rc2+ this patch oopses, too. I don't have serial console, so it is
   hard to tell if it is the same oops.
 
 But... I'm not sure I'm getting the same oops.
   Pavel

Any progress as to what is causing the oops for you starting at 4.2-rc2?

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


Re: [PATCH RESEND] irqchip: omap-intc: improve IRQ handler

2015-07-20 Thread Felipe Balbi
On Mon, Jul 20, 2015 at 10:44:08PM +0200, Thomas Gleixner wrote:
 On Mon, 20 Jul 2015, Felipe Balbi wrote:
  +   irqnr = intc_readl(INTC_SIR);
  +   irqnr = ACTIVEIRQ_MASK;
  +   WARN(!irqnr, Spurious IRQ ?\n);
 
 Shouldn't that be WARN_ONCE?

Sure, why not ?

8

From a71590d725e54b888db278de6c278d2a106fc76d Mon Sep 17 00:00:00 2001
From: Felipe Balbi ba...@ti.com
Date: Fri, 2 Jan 2015 16:18:54 -0600
Subject: [PATCH RESEND v2] irqchip: omap-intc: improve IRQ handler

as it turns out the current IRQ number will
*always* be available from SIR register which
renders the reads of PENDING registers as plain
unnecessary overhead.

In order to catch any situation where SIR reads
as zero, we're adding a WARN() to turn it into
a very verbose error and users actually report
it.

With this patch average running time of
omap_intc_handle_irq() reduced from about 28.5us
to 19.8us as measured by the kernel function
profiler.

Tested with BeagleBoneBlack Rev A5C.

Tested-by: Tony Lindgren t...@atomide.com
Signed-off-by: Felipe Balbi ba...@ti.com
---

Changes from V1:

 - replace WARN() with WARN_ONCE()

 drivers/irqchip/irq-omap-intc.c | 35 +--
 1 file changed, 5 insertions(+), 30 deletions(-)

diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index a569c6dbd1d1..e15f10746310 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -331,37 +331,12 @@ static int __init omap_init_irq(u32 base, struct 
device_node *node)
 static asmlinkage void __exception_irq_entry
 omap_intc_handle_irq(struct pt_regs *regs)
 {
-   u32 irqnr = 0;
-   int handled_irq = 0;
-   int i;
-
-   do {
-   for (i = 0; i  omap_nr_pending; i++) {
-   irqnr = intc_readl(INTC_PENDING_IRQ0 + (0x20 * i));
-   if (irqnr)
-   goto out;
-   }
-
-out:
-   if (!irqnr)
-   break;
-
-   irqnr = intc_readl(INTC_SIR);
-   irqnr = ACTIVEIRQ_MASK;
+   u32 irqnr;
 
-   if (irqnr) {
-   handle_domain_irq(domain, irqnr, regs);
-   handled_irq = 1;
-   }
-   } while (irqnr);
-
-   /*
-* If an irq is masked or deasserted while active, we will
-* keep ending up here with no irq handled. So remove it from
-* the INTC with an ack.
-*/
-   if (!handled_irq)
-   omap_ack_irq(NULL);
+   irqnr = intc_readl(INTC_SIR);
+   irqnr = ACTIVEIRQ_MASK;
+   WARN_ONCE(!irqnr, Spurious IRQ ?\n);
+   handle_domain_irq(domain, irqnr, regs);
 }
 
 void __init omap3_init_irq(void)
-- 
2.4.4


-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] ARM: dts: omap5-uevm: Add Palmas power button support

2015-07-20 Thread Nishanth Menon
On 07/20/2015 04:07 PM, Aparna Balasubramanian wrote:
 Palmas on OMAP5uevm has support for power button, so enable it.
 
 Signed-off-by: Aparna Balasubramanian apar...@ti.com
 ---
 
 Based on kernel tag 4.2.0-rc1 and test result log is at
 http://pastebin.ubuntu.com/11910178/
 
  arch/arm/boot/dts/omap5-uevm.dts |7 +++
  1 file changed, 7 insertions(+)
 
 diff --git a/arch/arm/boot/dts/omap5-uevm.dts 
 b/arch/arm/boot/dts/omap5-uevm.dts
 index 275618f..3cc8f35 100644
 --- a/arch/arm/boot/dts/omap5-uevm.dts
 +++ b/arch/arm/boot/dts/omap5-uevm.dts
 @@ -510,6 +510,13 @@
   };
   };
   };
 +
 + palmas_power_button: palmas_power_button {
 + compatible = ti,palmas-pwrbutton;
 + interrupt-parent = palmas;
 + interrupts = 1 IRQ_TYPE_EDGE_FALLING;
 + wakeup-source;
 + };
   };
  
   twl6040: twl@4b {
 

Tested (with evtest) and verified on v4.2-rc3

Acked-by: Nishanth Menon n...@ti.com

-- 
Regards,
Nishanth Menon
--
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 4.2-rc1 broken Nokia N900

2015-07-20 Thread Pali Rohár
On Monday 20 July 2015 22:46:47 Michael Welling wrote:
 On Tue, Jul 14, 2015 at 09:14:12AM +0200, Pali Rohár wrote:
  On Monday 13 July 2015 17:36:07 Michael Welling wrote:
   On Tue, Jul 14, 2015 at 12:02:44AM +0200, Pali Rohár wrote:
I think nothing special. I just call:

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
make rx51_defconfig
rm -f arch/arm/boot/zImage
make -j12 zImage modules omap3-n900.dtb
CONFIG_DEBUG_SECTION_MISMATCH=y cat arch/arm/boot/zImage
arch/arm/boot/dts/omap3-n900.dtb  arch/arm/boot/zImage.new mv
arch/arm/boot/zImage.new arch/arm/boot/zImage
   
   Where are you getting rx51_defconfig from?
   
   This does not appear to be in the kernel source any longer.
   
   Can you try the above with omap2plus_defconfig?
  
  It is in my linux-n900 repository:
  https://github.com/pali/linux-n900 Repository contains more n900
  specific patches but SPI code is unpatched
  
  https://github.com/pali/linux-n900/blob/HEAD/arch/arm/configs/rx51_
  defconfig
  
  Later in week I can try to compile also with omap2plus_defconfig...
  But in my opinion kernel should not crash with different
  configuration.
 
 Has any progress been made on this?
 

Hi, sorry but I did not have time last weekend for testing...

 Seeing as I was dropped into the middle of this thread,
 I took a look at the discussion previous.
 
 It appears that you are building the drivers as modules.
 Perhaps I can again attempt to duplicate the issue using modules.
 Though this should not make a difference.

Yes, you can try to build drivers as modules. Also you can try to use my 
rx51_defconfig. Maybe you find something more...

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


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


[PATCH] ARM: dts: omap5-uevm: Add Palmas power button support

2015-07-20 Thread Aparna Balasubramanian
Palmas on OMAP5uevm has support for power button, so enable it.

Signed-off-by: Aparna Balasubramanian apar...@ti.com
---

Based on kernel tag 4.2.0-rc1 and test result log is at
http://pastebin.ubuntu.com/11910178/

 arch/arm/boot/dts/omap5-uevm.dts |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 275618f..3cc8f35 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -510,6 +510,13 @@
};
};
};
+
+   palmas_power_button: palmas_power_button {
+   compatible = ti,palmas-pwrbutton;
+   interrupt-parent = palmas;
+   interrupts = 1 IRQ_TYPE_EDGE_FALLING;
+   wakeup-source;
+   };
};
 
twl6040: twl@4b {
-- 
1.7.9.5

--
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] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam Lee
Hi Peter, I sent a V2 with corrected wording. My bad!

And yes I agree that register setting should be done in the ADC driver.
Let me see what I can do, and will report back.

Thanks,

Adam

On Mon, Jul 20, 2015 at 11:54 AM, Peter Meerwald pme...@pmeerw.net wrote:
 On Mon, 20 Jul 2015, Adam YH Lee wrote:

 MADC[3:6] reads incorrect values without these two following changes:

 - enable the 3v1 bias regulator for ADC[3:6]
 - configure ADC[3:6] lines as input, not as USB

 comments below

 Signed-off-by: Adam YH Lee adam.yh@gmail.com
 ---
  drivers/iio/adc/twl4030-madc.c | 14 ++
  drivers/phy/phy-twl4030-usb.c  |  7 +++
  2 files changed, 21 insertions(+)

 diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
 index 94c5f05..b5020ab 100644
 --- a/drivers/iio/adc/twl4030-madc.c
 +++ b/drivers/iio/adc/twl4030-madc.c
 @@ -45,6 +45,7 @@
  #include linux/types.h
  #include linux/gfp.h
  #include linux/err.h
 +#include linux/regulator/consumer.h

  #include linux/iio/iio.h

 @@ -52,6 +53,7 @@
   * struct twl4030_madc_data - a container for madc info
   * @dev: Pointer to device structure for madc
   * @lock:Mutex protecting this data structure
 + * @regulator:   Pointer to bias regulator for madc
   * @requests:Array of request struct corresponding to SW1, 
 SW2 and RT
   * @use_second_irq:  IRQ selection (main or co-processor)
   * @imr: Interrupt mask register of MADC
 @@ -60,6 +62,7 @@
  struct twl4030_madc_data {
   struct device *dev;
   struct mutex lock;  /* mutex protecting this data structure */
 + struct regulator *usb3v1;
   struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
   bool use_second_irq;
   u8 imr;
 @@ -848,6 +851,14 @@ static int twl4030_madc_probe(struct platform_device 
 *pdev)
   goto err_i2c;
   }

 + madc-usb3v1 = devm_regulator_get(madc-dev, vusb3v1);
 + if (IS_ERR(madc-usb3v1))
 + return -ENODEV;
 +
 + ret = regulator_enable(madc-usb3v1);
 + if (ret)
 + dev_err(madc-dev, could not be enable 3v1 bias regulator\n);

 please fix wording, could not enable usb 3v1 bias regulator probably

 +
   return 0;

  err_i2c:
 @@ -867,6 +878,9 @@ static int twl4030_madc_remove(struct platform_device 
 *pdev)
   twl4030_madc_set_current_generator(madc, 0, 0);
   twl4030_madc_set_power(madc, 0);

 + regulator_disable(madc-usb3v1);
 + regulator_put(madc-usb3v1);
 +
   return 0;
  }

 diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
 index 7b04bef..88fc7d7 100644
 --- a/drivers/phy/phy-twl4030-usb.c
 +++ b/drivers/phy/phy-twl4030-usb.c
 @@ -144,6 +144,9 @@
  #define PMBR10x0D
  #define GPIO_USB_4PIN_ULPI_2430C (3  0)

 +#define TWL4030_USB_SEL_MADC_MCPC(13)
 +#define TWL4030_USB_CARKIT_ANA_CTRL  0xBB
 +
  struct twl4030_usb {
   struct usb_phy  phy;
   struct device   *dev;
 @@ -459,6 +462,10 @@ static int twl4030_phy_power_on(struct phy *phy)
   twl4030_i2c_access(twl, 0);
   schedule_delayed_work(twl-id_workaround_work, 0);

 + twl4030_usb_write(twl, TWL4030_USB_CARKIT_ANA_CTRL,
 + twl4030_usb_read(twl, TWL4030_USB_CARKIT_ANA_CTRL) |
 + TWL4030_USB_SEL_MADC_MCPC);
 +

 shouldn't this be done is the adc driver?

   return 0;
  }



 --

 Peter Meerwald
 +43-664-218 (mobile)
--
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


[V2] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam YH Lee
MADC[3:6] reads incorrect values without these two following changes:

- enable the 3v1 bias regulator for ADC[3:6]
- configure ADC[3:6] lines as input, not as USB

Signed-off-by: Adam YH Lee adam.yh@gmail.com
---
 drivers/iio/adc/twl4030-madc.c | 14 ++
 drivers/phy/phy-twl4030-usb.c  |  7 +++
 2 files changed, 21 insertions(+)

diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 94c5f05..92f290e 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -45,6 +45,7 @@
 #include linux/types.h
 #include linux/gfp.h
 #include linux/err.h
+#include linux/regulator/consumer.h
 
 #include linux/iio/iio.h
 
@@ -52,6 +53,7 @@
  * struct twl4030_madc_data - a container for madc info
  * @dev:   Pointer to device structure for madc
  * @lock:  Mutex protecting this data structure
+ * @regulator: Pointer to bias regulator for madc
  * @requests:  Array of request struct corresponding to SW1, SW2 and RT
  * @use_second_irq:IRQ selection (main or co-processor)
  * @imr:   Interrupt mask register of MADC
@@ -60,6 +62,7 @@
 struct twl4030_madc_data {
struct device *dev;
struct mutex lock;  /* mutex protecting this data structure */
+   struct regulator *usb3v1;
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
bool use_second_irq;
u8 imr;
@@ -848,6 +851,14 @@ static int twl4030_madc_probe(struct platform_device *pdev)
goto err_i2c;
}
 
+   madc-usb3v1 = devm_regulator_get(madc-dev, vusb3v1);
+   if (IS_ERR(madc-usb3v1))
+   return -ENODEV;
+
+   ret = regulator_enable(madc-usb3v1);
+   if (ret)
+   dev_err(madc-dev, could not enable 3v1 bias regulator\n);
+
return 0;
 
 err_i2c:
@@ -867,6 +878,9 @@ static int twl4030_madc_remove(struct platform_device *pdev)
twl4030_madc_set_current_generator(madc, 0, 0);
twl4030_madc_set_power(madc, 0);
 
+   regulator_disable(madc-usb3v1);
+   regulator_put(madc-usb3v1);
+
return 0;
 }
 
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 7b04bef..88fc7d7 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -144,6 +144,9 @@
 #define PMBR1  0x0D
 #define GPIO_USB_4PIN_ULPI_2430C   (3  0)
 
+#define TWL4030_USB_SEL_MADC_MCPC  (13)
+#define TWL4030_USB_CARKIT_ANA_CTRL0xBB
+
 struct twl4030_usb {
struct usb_phy  phy;
struct device   *dev;
@@ -459,6 +462,10 @@ static int twl4030_phy_power_on(struct phy *phy)
twl4030_i2c_access(twl, 0);
schedule_delayed_work(twl-id_workaround_work, 0);
 
+   twl4030_usb_write(twl, TWL4030_USB_CARKIT_ANA_CTRL,
+   twl4030_usb_read(twl, TWL4030_USB_CARKIT_ANA_CTRL) |
+   TWL4030_USB_SEL_MADC_MCPC);
+
return 0;
 }
 
-- 
2.1.4

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


Re: [PATCH] ARM: OMAP2+: Remove module references from IOMMU machine layer

2015-07-20 Thread Suman Anna
Hi Tony,

On 07/16/2015 02:16 AM, Tony Lindgren wrote:
 * Suman Anna s-a...@ti.com [150710 13:45]:
 The OMAP IOMMU driver has been adapted to the IOMMU framework
 for a while now, and it no longer supports being built as a
 module. Cleanup all the module related references both from
 the code and in the build.

 While at it, also relocate a comment around the initcall to
 avoid a checkpatch strict warning about using a blank line
 after function/struct/union/enum declarations.
 
 OK applying into omap-for-v4.3/soc.

Thanks.

 
 You may want to check few things after this:
 
 - Does it still need to be omap_subsys_initcall or can it
   happen later? Anything we can initialize later on is worth
   doing as then we have proper debug console available.

This code will be cleaned up once the non-DT references/users for OMAP3
IOMMUs go away. I will do this in the next merge window once Laurent's
OMAP3ISP legacy device creation cleanup series gets into mainline [1].

 
 - For multi_v7_defconfig it would be nice to be able to
   make the driver/iommu components into standard Linux
   loadable modules.

We used to be module before, and the built-in is coming from the IOMMU
framework. The init function in the OMAP IOMMU driver already handles
the multi_v7_defconfig scenario, so no issues there.

 
 - Actually you can probably get rid of mach-omap2/omap-iommu.c
   completely by implementing PM runtime and and possibly
   reset controller.

Yeah, any need for this file after the non-DT device creation removal
would arises from the PRCM/reset dependencies against API present in
mach-omap2 layer only.

regards
Suman

[1] http://marc.info/?l=linux-omapm=143705130631733w=2
--
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


[V3] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam YH Lee
MADC[3:6] reads incorrect values without these two following changes:

- enable the 3v1 bias regulator for ADC[3:6]
- configure ADC[3:6] lines as input, not as USB

Signed-off-by: Adam YH Lee adam.yh@gmail.com
---
 drivers/iio/adc/twl4030-madc.c | 36 
 1 file changed, 36 insertions(+)

diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 94c5f05..ae33eba 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -45,13 +45,18 @@
 #include linux/types.h
 #include linux/gfp.h
 #include linux/err.h
+#include linux/regulator/consumer.h
 
 #include linux/iio/iio.h
 
+#define TWL4030_USB_SEL_MADC_MCPC  (13)
+#define TWL4030_USB_CARKIT_ANA_CTRL0xBB
+
 /**
  * struct twl4030_madc_data - a container for madc info
  * @dev:   Pointer to device structure for madc
  * @lock:  Mutex protecting this data structure
+ * @regulator: Pointer to bias regulator for madc
  * @requests:  Array of request struct corresponding to SW1, SW2 and RT
  * @use_second_irq:IRQ selection (main or co-processor)
  * @imr:   Interrupt mask register of MADC
@@ -60,6 +65,7 @@
 struct twl4030_madc_data {
struct device *dev;
struct mutex lock;  /* mutex protecting this data structure */
+   struct regulator *usb3v1;
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
bool use_second_irq;
u8 imr;
@@ -848,6 +854,33 @@ static int twl4030_madc_probe(struct platform_device *pdev)
goto err_i2c;
}
 
+   /* Configure MADC[3:6] */
+   ret = twl_i2c_read_u8(TWL_MODULE_USB, regval,
+   TWL4030_USB_CARKIT_ANA_CTRL);
+   if (ret) {
+   dev_err(pdev-dev, unable to read reg CARKIT_ANA_CTRL  
0x%X\n,
+   TWL4030_USB_CARKIT_ANA_CTRL);
+   goto err_i2c;
+   }
+   regval |= TWL4030_USB_SEL_MADC_MCPC;
+   ret = twl_i2c_write_u8(TWL_MODULE_USB, regval,
+TWL4030_USB_CARKIT_ANA_CTRL);
+   if (ret) {
+   dev_err(pdev-dev, unable to write reg CARKIT_ANA_CTRL 
0x%X\n,
+   TWL4030_USB_CARKIT_ANA_CTRL);
+   goto err_i2c;
+   }
+
+
+   /* Enable 3v1 bias regulator for MADC[3:6] */
+   madc-usb3v1 = devm_regulator_get(madc-dev, vusb3v1);
+   if (IS_ERR(madc-usb3v1))
+   return -ENODEV;
+
+   ret = regulator_enable(madc-usb3v1);
+   if (ret)
+   dev_err(madc-dev, could not enable 3v1 bias regulator\n);
+
return 0;
 
 err_i2c:
@@ -867,6 +900,9 @@ static int twl4030_madc_remove(struct platform_device *pdev)
twl4030_madc_set_current_generator(madc, 0, 0);
twl4030_madc_set_power(madc, 0);
 
+   regulator_disable(madc-usb3v1);
+   devm_regulator_put(madc-usb3v1);
+
return 0;
 }
 
-- 
2.1.4

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


Re: [V3] [TWL4030 MADC] Fix ADC[3:6] readings

2015-07-20 Thread Adam Lee
Hello Peter,
Just sent up the V3 of my patch. Register configuration is now done in
madc driver code.

Another difference from V2 and V1 is that I am using
`devm_regulator_put` instead of
`regulator_put` to match the `devm_regulator_get` call.

I've tested it on Gumstix Overo (OMAP3 + TPS65950).

Let me know,

Adam

On Mon, Jul 20, 2015 at 5:49 PM, Adam YH Lee adam.yh@gmail.com wrote:
 MADC[3:6] reads incorrect values without these two following changes:

 - enable the 3v1 bias regulator for ADC[3:6]
 - configure ADC[3:6] lines as input, not as USB

 Signed-off-by: Adam YH Lee adam.yh@gmail.com
 ---
  drivers/iio/adc/twl4030-madc.c | 36 
  1 file changed, 36 insertions(+)

 diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
 index 94c5f05..ae33eba 100644
 --- a/drivers/iio/adc/twl4030-madc.c
 +++ b/drivers/iio/adc/twl4030-madc.c
 @@ -45,13 +45,18 @@
  #include linux/types.h
  #include linux/gfp.h
  #include linux/err.h
 +#include linux/regulator/consumer.h

  #include linux/iio/iio.h

 +#define TWL4030_USB_SEL_MADC_MCPC  (13)
 +#define TWL4030_USB_CARKIT_ANA_CTRL0xBB
 +
  /**
   * struct twl4030_madc_data - a container for madc info
   * @dev:   Pointer to device structure for madc
   * @lock:  Mutex protecting this data structure
 + * @regulator: Pointer to bias regulator for madc
   * @requests:  Array of request struct corresponding to SW1, SW2 and 
 RT
   * @use_second_irq:IRQ selection (main or co-processor)
   * @imr:   Interrupt mask register of MADC
 @@ -60,6 +65,7 @@
  struct twl4030_madc_data {
 struct device *dev;
 struct mutex lock;  /* mutex protecting this data structure */
 +   struct regulator *usb3v1;
 struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
 bool use_second_irq;
 u8 imr;
 @@ -848,6 +854,33 @@ static int twl4030_madc_probe(struct platform_device 
 *pdev)
 goto err_i2c;
 }

 +   /* Configure MADC[3:6] */
 +   ret = twl_i2c_read_u8(TWL_MODULE_USB, regval,
 +   TWL4030_USB_CARKIT_ANA_CTRL);
 +   if (ret) {
 +   dev_err(pdev-dev, unable to read reg CARKIT_ANA_CTRL  
 0x%X\n,
 +   TWL4030_USB_CARKIT_ANA_CTRL);
 +   goto err_i2c;
 +   }
 +   regval |= TWL4030_USB_SEL_MADC_MCPC;
 +   ret = twl_i2c_write_u8(TWL_MODULE_USB, regval,
 +TWL4030_USB_CARKIT_ANA_CTRL);
 +   if (ret) {
 +   dev_err(pdev-dev, unable to write reg CARKIT_ANA_CTRL 
 0x%X\n,
 +   TWL4030_USB_CARKIT_ANA_CTRL);
 +   goto err_i2c;
 +   }
 +
 +
 +   /* Enable 3v1 bias regulator for MADC[3:6] */
 +   madc-usb3v1 = devm_regulator_get(madc-dev, vusb3v1);
 +   if (IS_ERR(madc-usb3v1))
 +   return -ENODEV;
 +
 +   ret = regulator_enable(madc-usb3v1);
 +   if (ret)
 +   dev_err(madc-dev, could not enable 3v1 bias regulator\n);
 +
 return 0;

  err_i2c:
 @@ -867,6 +900,9 @@ static int twl4030_madc_remove(struct platform_device 
 *pdev)
 twl4030_madc_set_current_generator(madc, 0, 0);
 twl4030_madc_set_power(madc, 0);

 +   regulator_disable(madc-usb3v1);
 +   devm_regulator_put(madc-usb3v1);
 +
 return 0;
  }

 --
 2.1.4

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


[PATCH 4/4] ARM: OMAP2+: omap3-pandora: add wifi support

2015-07-20 Thread Grazvydas Ignotas
Add wl1251 support via pdata-quirks as it's driver lacks DT
support. MMC3 is marked disabled in DT so that MMC3 instance of
hsmmc driver is probed using platform data with special card init
callback.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 arch/arm/boot/dts/omap3-pandora-common.dtsi |   5 ++
 arch/arm/mach-omap2/pdata-quirks.c  | 101 
 2 files changed, 106 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-pandora-common.dtsi 
b/arch/arm/boot/dts/omap3-pandora-common.dtsi
index 6e82c4a..f2084e6 100644
--- a/arch/arm/boot/dts/omap3-pandora-common.dtsi
+++ b/arch/arm/boot/dts/omap3-pandora-common.dtsi
@@ -514,6 +514,11 @@
/*wp-gpios = gpio4 31 GPIO_ACTIVE_HIGH;*//* GPIO_127 */
 };
 
+/* mmc3 is probed using pdata-quirks to pass wl1251 card data */
+mmc3 {
+   status = disabled;
+};
+
 /* bluetooth*/
 uart1 {
 };
diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index 3c97aa49..95f6724 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -14,6 +14,11 @@
 #include linux/kernel.h
 #include linux/of_platform.h
 #include linux/ti_wilink_st.h
+#include linux/wl12xx.h
+#include linux/mmc/card.h
+#include linux/mmc/host.h
+#include linux/regulator/machine.h
+#include linux/regulator/fixed.h
 
 #include linux/platform_data/pinctrl-single.h
 #include linux/platform_data/iommu-omap.h
@@ -25,6 +30,7 @@
 #include omap_device.h
 #include omap-secure.h
 #include soc.h
+#include hsmmc.h
 
 struct pdata_init {
const char *compatible;
@@ -269,14 +275,109 @@ static void __init omap3_tao3530_legacy_init(void)
hsmmc2_internal_input_clk();
 }
 
+/* omap3pandora legacy devices */
+#define PANDORA_WIFI_IRQ_GPIO  21
+#define PANDORA_WIFI_NRESET_GPIO   23
+
 static struct platform_device pandora_backlight = {
.name   = pandora-backlight,
.id = -1,
 };
 
+static struct regulator_consumer_supply pandora_vmmc3_supply[] = {
+   REGULATOR_SUPPLY(vmmc, omap_hsmmc.2),
+};
+
+static struct regulator_init_data pandora_vmmc3 = {
+   .constraints = {
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(pandora_vmmc3_supply),
+   .consumer_supplies  = pandora_vmmc3_supply,
+};
+
+static struct fixed_voltage_config pandora_vwlan = {
+   .supply_name= vwlan,
+   .microvolts = 180, /* 1.8V */
+   .gpio   = PANDORA_WIFI_NRESET_GPIO,
+   .startup_delay  = 5, /* 50ms */
+   .enable_high= 1,
+   .init_data  = pandora_vmmc3,
+};
+
+static struct platform_device pandora_vwlan_device = {
+   .name   = reg-fixed-voltage,
+   .id = 1,
+   .dev = {
+   .platform_data = pandora_vwlan,
+   },
+};
+
+static void pandora_wl1251_init_card(struct mmc_card *card)
+{
+   /*
+* We have TI wl1251 attached to MMC3. Pass this information to
+* SDIO core because it can't be probed by normal methods.
+*/
+   if (card-type == MMC_TYPE_SDIO || card-type == MMC_TYPE_SD_COMBO) {
+   card-quirks |= MMC_QUIRK_NONSTD_SDIO;
+   card-cccr.wide_bus = 1;
+   card-cis.vendor = 0x104c;
+   card-cis.device = 0x9066;
+   card-cis.blksize = 512;
+   card-cis.max_dtr = 2400;
+   card-ocr = 0x80;
+   }
+}
+
+static struct omap2_hsmmc_info pandora_mmc3[] = {
+   {
+   .mmc= 3,
+   .caps   = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
+   .gpio_cd= -EINVAL,
+   .gpio_wp= -EINVAL,
+   .init_card  = pandora_wl1251_init_card,
+   },
+   {}  /* Terminator */
+};
+
+static void __init pandora_wl1251_init(void)
+{
+   struct wl1251_platform_data pandora_wl1251_pdata;
+   int ret;
+
+   memset(pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
+
+   pandora_wl1251_pdata.power_gpio = -1;
+
+   ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, wl1251 irq);
+   if (ret  0)
+   goto fail;
+
+   pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
+   if (pandora_wl1251_pdata.irq  0)
+   goto fail_irq;
+
+   pandora_wl1251_pdata.use_eeprom = true;
+   ret = wl1251_set_platform_data(pandora_wl1251_pdata);
+   if (ret  0)
+   goto fail_irq;
+
+   return;
+
+fail_irq:
+   gpio_free(PANDORA_WIFI_IRQ_GPIO);
+fail:
+   pr_err(wl1251 board initialisation failed\n);
+}
+
 static void __init omap3_pandora_legacy_init(void)
 {
platform_device_register(pandora_backlight);
+   platform_device_register(pandora_vwlan_device);
+   omap_hsmmc_init(pandora_mmc3);
+   omap_hsmmc_late_init(pandora_mmc3);
+   

[PATCH 1/4] ARM: dts: omap3-pandora: miscellaneous corrections

2015-07-20 Thread Grazvydas Ignotas
- add pandora specific compatible name
- fix mmc2 card detect polarity
- fix mmc1 and mmc2 write protect polarity
- disable write protect pins because of production issue and add an
  explanation why they are disabled
- fix NAND partition name to reflect the correct address

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 arch/arm/boot/dts/omap3-pandora-1ghz.dts|  2 +-
 arch/arm/boot/dts/omap3-pandora-600mhz.dts  |  2 +-
 arch/arm/boot/dts/omap3-pandora-common.dtsi | 13 +
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-pandora-1ghz.dts 
b/arch/arm/boot/dts/omap3-pandora-1ghz.dts
index 9619a28..25498f7 100644
--- a/arch/arm/boot/dts/omap3-pandora-1ghz.dts
+++ b/arch/arm/boot/dts/omap3-pandora-1ghz.dts
@@ -19,7 +19,7 @@
 / {
model = Pandora Handheld Console 1GHz;
 
-   compatible = ti,omap36xx, ti,omap3;
+   compatible = openpandora,omap3-pandora-1ghz, ti,omap36xx, 
ti,omap3;
 };
 
 omap3_pmx_core2 {
diff --git a/arch/arm/boot/dts/omap3-pandora-600mhz.dts 
b/arch/arm/boot/dts/omap3-pandora-600mhz.dts
index fb803a7..8775897 100644
--- a/arch/arm/boot/dts/omap3-pandora-600mhz.dts
+++ b/arch/arm/boot/dts/omap3-pandora-600mhz.dts
@@ -19,7 +19,7 @@
 / {
model = Pandora Handheld Console;
 
-   compatible = ti,omap3;
+   compatible = openpandora,omap3-pandora-600mhz, ti,omap3430, 
ti,omap3;
 };
 
 omap3_pmx_core2 {
diff --git a/arch/arm/boot/dts/omap3-pandora-common.dtsi 
b/arch/arm/boot/dts/omap3-pandora-common.dtsi
index 782ab1f..f6363bc 100644
--- a/arch/arm/boot/dts/omap3-pandora-common.dtsi
+++ b/arch/arm/boot/dts/omap3-pandora-common.dtsi
@@ -459,13 +459,18 @@
power = 50;
 };
 
+/*
+ * Many pandora boards have been produced with defective write-protect switches
+ * on either slot, so it was decided not to use this feature. If you know
+ * your board has good switches, feel free to uncomment wp-gpios below.
+ */
 mmc1 {
pinctrl-names = default;
pinctrl-0 = mmc1_pins;
vmmc-supply = vmmc1;
bus-width = 4;
cd-gpios = twl_gpio 0 GPIO_ACTIVE_LOW;
-   wp-gpios = gpio4 30 GPIO_ACTIVE_LOW; /* GPIO_126 */
+   /*wp-gpios = gpio4 30 GPIO_ACTIVE_HIGH;*//* GPIO_126 */
 };
 
 mmc2 {
@@ -473,8 +478,8 @@
pinctrl-0 = mmc2_pins;
vmmc-supply = vmmc2;
bus-width = 4;
-   cd-gpios = twl_gpio 1 GPIO_ACTIVE_HIGH;
-   wp-gpios = gpio4 31 GPIO_ACTIVE_LOW; /* GPIO_127 */
+   cd-gpios = twl_gpio 1 GPIO_ACTIVE_LOW;
+   /*wp-gpios = gpio4 31 GPIO_ACTIVE_HIGH;*//* GPIO_127 */
 };
 
 /* bluetooth*/
@@ -545,7 +550,7 @@
reg = 0x28 0xa0;
};
 
-   filesystem@68 {
+   filesystem@c8 {
label = rootfs;
reg = 0xc8 0; /* 0 = MTDPART_SIZ_FULL */
};
-- 
1.9.1

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


[PATCH 2/4] ARM: dts: omap3-pandora: add support for usb host and 32k buffer

2015-07-20 Thread Grazvydas Ignotas
This adds missing bits for EHCI HS USB host support and 32k clock
buffer control for the wg7210 bt+wifi module.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 arch/arm/boot/dts/omap3-pandora-common.dtsi | 36 +
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-pandora-common.dtsi 
b/arch/arm/boot/dts/omap3-pandora-common.dtsi
index f6363bc..6e82c4a 100644
--- a/arch/arm/boot/dts/omap3-pandora-common.dtsi
+++ b/arch/arm/boot/dts/omap3-pandora-common.dtsi
@@ -199,6 +199,38 @@
gpios = gpio4 12 GPIO_ACTIVE_HIGH;   /* GPIO_108 */
};
};
+
+   /* HS USB Host PHY on PORT 2 */
+   hsusb2_phy: hsusb2_phy {
+   compatible = usb-nop-xceiv;
+   reset-gpios = gpio1 16 GPIO_ACTIVE_LOW; /* GPIO_16 */
+   vcc-supply = vaux2;
+   };
+
+   /* HS USB Host VBUS supply
+* disabling this regulator causes current leakage, and LCD flicker
+* on earlier (CC) board revisions, so keep it always on */
+   usb_host_5v: fixed-regulator-usb_host_5v {
+   compatible = regulator-fixed;
+   regulator-name = usb_host_5v;
+   regulator-min-microvolt = 500;
+   regulator-max-microvolt = 500;
+   regulator-always-on;
+   regulator-boot-on;
+   enable-active-high;
+   gpio = gpio6 4 0;/* GPIO_164 */
+   };
+
+   /* wg7210 (wifi+bt module) 32k clock buffer */
+   wg7210_32k: fixed-regulator-wg7210_32k {
+   compatible = regulator-fixed;
+   regulator-name = wg7210_32k;
+   regulator-min-microvolt = 180;
+   regulator-max-microvolt = 180;
+   regulator-always-on;
+   enable-active-high;
+   gpio = twl_gpio 13 GPIO_ACTIVE_HIGH;
+   };
 };
 
 omap3_pmx_core {
@@ -501,6 +533,10 @@
port2-mode = ehci-phy;
 };
 
+usbhsehci {
+   phys = 0 hsusb2_phy;
+};
+
 gpmc {
ranges = 0 0 0x3000 0x100; /* CS0: 16MB for NAND */
 
-- 
1.9.1

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


[PATCH 3/4] ARM: OMAP2+: omap3-pandora: add backlight support

2015-07-20 Thread Grazvydas Ignotas
Add backlight support via pdata-quirks as it's driver lacks DT support.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 arch/arm/mach-omap2/pdata-quirks.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index 821171c..3c97aa49 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -268,6 +268,16 @@ static void __init omap3_tao3530_legacy_init(void)
 {
hsmmc2_internal_input_clk();
 }
+
+static struct platform_device pandora_backlight = {
+   .name   = pandora-backlight,
+   .id = -1,
+};
+
+static void __init omap3_pandora_legacy_init(void)
+{
+   platform_device_register(pandora_backlight);
+}
 #endif /* CONFIG_ARCH_OMAP3 */
 
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
@@ -381,6 +391,8 @@ static struct pdata_init pdata_quirks[] __initdata = {
{ ti,omap3-evm-37xx, omap3_evm_legacy_init, },
{ ti,am3517-evm, am3517_evm_legacy_init, },
{ technexion,omap3-tao3530, omap3_tao3530_legacy_init, },
+   { openpandora,omap3-pandora-600mhz, omap3_pandora_legacy_init, },
+   { openpandora,omap3-pandora-1ghz, omap3_pandora_legacy_init, },
 #endif
 #ifdef CONFIG_SOC_OMAP5
{ ti,omap5-uevm, omap5_uevm_legacy_init, },
-- 
1.9.1

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


[PATCH 06/11] iommu/omap: Remove trailing semi-colon from a macro

2015-07-20 Thread Suman Anna
Remove the trailing semi-colon in the DEBUG_FOPS_RO macro
definition. This fixes the checking warning,
WARNING: macros should not use a trailing semicolon

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu-debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index b4b96db37e6a..e9f116f18531 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -265,7 +265,7 @@ static int debug_read_pagetable(struct seq_file *s, void 
*data)
.open = simple_open,\
.read = debug_read_##name,  \
.llseek = generic_file_llseek,  \
-   };
+   }
 
 DEBUG_FOPS_RO(regs);
 DEBUG_FOPS_RO(tlb);
-- 
2.4.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 03/11] iommu/omap: Move debugfs functions to omap-iommu-debug.c

2015-07-20 Thread Suman Anna
The main OMAP IOMMU driver file has some helper functions used
by the OMAP IOMMU debugfs functionality, and there is already a
dedicated source file omap-iommu-debug.c dealing with these debugfs
routines. Move all these functions to the omap-iommu-debug.c file,
so that all the debugfs related routines are in one place.

The move required exposing some new functions and moving some
definitions to the internal omap-iommu.h header file.

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu-debug.c | 111 +
 drivers/iommu/omap-iommu.c   | 148 +--
 drivers/iommu/omap-iommu.h   |  28 ++--
 3 files changed, 137 insertions(+), 150 deletions(-)

diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c
index f3d20a2039d2..b4b96db37e6a 100644
--- a/drivers/iommu/omap-iommu-debug.c
+++ b/drivers/iommu/omap-iommu-debug.c
@@ -14,6 +14,7 @@
 #include linux/io.h
 #include linux/slab.h
 #include linux/uaccess.h
+#include linux/pm_runtime.h
 #include linux/debugfs.h
 #include linux/platform_data/iommu-omap.h
 
@@ -29,6 +30,59 @@ static inline bool is_omap_iommu_detached(struct omap_iommu 
*obj)
return !obj-domain;
 }
 
+#define pr_reg(name)   \
+   do {\
+   ssize_t bytes;  \
+   const char *str = %20s: %08x\n;   \
+   const int maxcol = 32;  \
+   bytes = snprintf(p, maxcol, str, __stringify(name), \
+iommu_read_reg(obj, MMU_##name));  \
+   p += bytes; \
+   len -= bytes;   \
+   if (len  maxcol)   \
+   goto out;   \
+   } while (0)
+
+static ssize_t
+omap2_iommu_dump_ctx(struct omap_iommu *obj, char *buf, ssize_t len)
+{
+   char *p = buf;
+
+   pr_reg(REVISION);
+   pr_reg(IRQSTATUS);
+   pr_reg(IRQENABLE);
+   pr_reg(WALKING_ST);
+   pr_reg(CNTL);
+   pr_reg(FAULT_AD);
+   pr_reg(TTB);
+   pr_reg(LOCK);
+   pr_reg(LD_TLB);
+   pr_reg(CAM);
+   pr_reg(RAM);
+   pr_reg(GFLUSH);
+   pr_reg(FLUSH_ENTRY);
+   pr_reg(READ_CAM);
+   pr_reg(READ_RAM);
+   pr_reg(EMU_FAULT_AD);
+out:
+   return p - buf;
+}
+
+static ssize_t omap_iommu_dump_ctx(struct omap_iommu *obj, char *buf,
+  ssize_t bytes)
+{
+   if (!obj || !buf)
+   return -EINVAL;
+
+   pm_runtime_get_sync(obj-dev);
+
+   bytes = omap2_iommu_dump_ctx(obj, buf, bytes);
+
+   pm_runtime_put_sync(obj-dev);
+
+   return bytes;
+}
+
 static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
   size_t count, loff_t *ppos)
 {
@@ -55,6 +109,63 @@ static ssize_t debug_read_regs(struct file *file, char 
__user *userbuf,
return bytes;
 }
 
+static int
+__dump_tlb_entries(struct omap_iommu *obj, struct cr_regs *crs, int num)
+{
+   int i;
+   struct iotlb_lock saved;
+   struct cr_regs tmp;
+   struct cr_regs *p = crs;
+
+   pm_runtime_get_sync(obj-dev);
+   iotlb_lock_get(obj, saved);
+
+   for_each_iotlb_cr(obj, num, i, tmp) {
+   if (!iotlb_cr_valid(tmp))
+   continue;
+   *p++ = tmp;
+   }
+
+   iotlb_lock_set(obj, saved);
+   pm_runtime_put_sync(obj-dev);
+
+   return  p - crs;
+}
+
+static ssize_t iotlb_dump_cr(struct omap_iommu *obj, struct cr_regs *cr,
+char *buf)
+{
+   char *p = buf;
+
+   /* FIXME: Need more detail analysis of cam/ram */
+   p += sprintf(p, %08x %08x %01x\n, cr-cam, cr-ram,
+   (cr-cam  MMU_CAM_P) ? 1 : 0);
+
+   return p - buf;
+}
+
+static size_t omap_dump_tlb_entries(struct omap_iommu *obj, char *buf,
+   ssize_t bytes)
+{
+   int i, num;
+   struct cr_regs *cr;
+   char *p = buf;
+
+   num = bytes / sizeof(*cr);
+   num = min(obj-nr_tlb_entries, num);
+
+   cr = kcalloc(num, sizeof(*cr), GFP_KERNEL);
+   if (!cr)
+   return 0;
+
+   num = __dump_tlb_entries(obj, cr, num);
+   for (i = 0; i  num; i++)
+   p += iotlb_dump_cr(obj, cr + i, p);
+   kfree(cr);
+
+   return p - buf;
+}
+
 static ssize_t debug_read_tlb(struct file *file, char __user *userbuf,
  size_t count, loff_t *ppos)
 {
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index eeecfc4073af..0fc00f31c39d 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c

[PATCH 04/11] iommu/omap: Protect omap-iopgtable.h against double inclusion

2015-07-20 Thread Suman Anna
Protect the omap-pgtable.h header against double inclusion in
source code by using the standard include guard mechanism.

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iopgtable.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/iommu/omap-iopgtable.h b/drivers/iommu/omap-iopgtable.h
index f891683e3f05..bfde5405f514 100644
--- a/drivers/iommu/omap-iopgtable.h
+++ b/drivers/iommu/omap-iopgtable.h
@@ -10,6 +10,9 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef _OMAP_IOPGTABLE_H
+#define _OMAP_IOPGTABLE_H
+
 /*
  * L2 table address mask and size definitions.
  */
@@ -93,3 +96,5 @@ static inline phys_addr_t omap_iommu_translate(u32 d, u32 va, 
u32 mask)
 /* to find an entry in the second-level page table. */
 #define iopte_index(da)(((da)  IOPTE_SHIFT)  
(PTRS_PER_IOPTE - 1))
 #define iopte_offset(iopgd, da)(iopgd_page_vaddr(iopgd) + 
iopte_index(da))
+
+#endif /* _OMAP_IOPGTABLE_H */
-- 
2.4.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 02/11] iommu/omap: Remove all module references

2015-07-20 Thread Suman Anna
The OMAP IOMMU driver has been adapted to the IOMMU framework
for a while now, and it does not support being built as a
module anymore. So, remove all the module references from the
OMAP IOMMU driver.

While at it, also relocate a comment around the subsys_initcall
to avoid a checkpatch strict warning about using a blank line
after function/struct/union/enum declarations.

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu.c | 19 +--
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index a22c33d6a486..eeecfc4073af 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -12,7 +12,6 @@
  */
 
 #include linux/err.h
-#include linux/module.h
 #include linux/slab.h
 #include linux/interrupt.h
 #include linux/ioport.h
@@ -1089,7 +1088,6 @@ static const struct of_device_id omap_iommu_of_match[] = {
{ .compatible = ti,dra7-iommu },
{},
 };
-MODULE_DEVICE_TABLE(of, omap_iommu_of_match);
 
 static struct platform_driver omap_iommu_driver = {
.probe  = omap_iommu_probe,
@@ -1405,20 +1403,5 @@ static int __init omap_iommu_init(void)
 
return platform_driver_register(omap_iommu_driver);
 }
-/* must be ready before omap3isp is probed */
 subsys_initcall(omap_iommu_init);
-
-static void __exit omap_iommu_exit(void)
-{
-   kmem_cache_destroy(iopte_cachep);
-
-   platform_driver_unregister(omap_iommu_driver);
-
-   omap_iommu_debugfs_exit();
-}
-module_exit(omap_iommu_exit);
-
-MODULE_DESCRIPTION(omap iommu: tlb and pagetable primitives);
-MODULE_ALIAS(platform:omap-iommu);
-MODULE_AUTHOR(Hiroshi DOYU, Paul Mundt and Toshihiro Kobayashi);
-MODULE_LICENSE(GPL v2);
+/* must be ready before omap3isp is probed */
-- 
2.4.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 10/11] iommu/omap: Align code with open parenthesis

2015-07-20 Thread Suman Anna
Fix all the occurrences of the following check warning
generated with the checkpatch --strict option:
CHECK: Alignment should match open parenthesis

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu.c | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 4328d9855edb..36d0033c2ccb 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -787,14 +787,14 @@ static irqreturn_t iommu_fault_handler(int irq, void 
*data)
 
if (!iopgd_is_table(*iopgd)) {
dev_err(obj-dev, %s: errs:0x%08x da:0x%08x pgd:0x%p 
*pgd:px%08x\n,
-   obj-name, errs, da, iopgd, *iopgd);
+   obj-name, errs, da, iopgd, *iopgd);
return IRQ_NONE;
}
 
iopte = iopte_offset(iopgd, da);
 
dev_err(obj-dev, %s: errs:0x%08x da:0x%08x pgd:0x%p *pgd:0x%08x 
pte:0x%p *pte:0x%08x\n,
-   obj-name, errs, da, iopgd, *iopgd, iopte, *iopte);
+   obj-name, errs, da, iopgd, *iopgd, iopte, *iopte);
 
return IRQ_NONE;
 }
@@ -820,9 +820,8 @@ static struct omap_iommu *omap_iommu_attach(const char 
*name, u32 *iopgd)
struct device *dev;
struct omap_iommu *obj;
 
-   dev = driver_find_device(omap_iommu_driver.driver, NULL,
-   (void *)name,
-   device_match_by_alias);
+   dev = driver_find_device(omap_iommu_driver.driver, NULL, (void *)name,
+device_match_by_alias);
if (!dev)
return ERR_PTR(-ENODEV);
 
@@ -977,7 +976,7 @@ static u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, 
u32 pa, int pgsz)
 }
 
 static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
-phys_addr_t pa, size_t bytes, int prot)
+ phys_addr_t pa, size_t bytes, int prot)
 {
struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
struct omap_iommu *oiommu = omap_domain-iommu_dev;
@@ -1004,7 +1003,7 @@ static int omap_iommu_map(struct iommu_domain *domain, 
unsigned long da,
 }
 
 static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da,
-   size_t size)
+  size_t size)
 {
struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
struct omap_iommu *oiommu = omap_domain-iommu_dev;
@@ -1055,7 +1054,7 @@ out:
 }
 
 static void _omap_iommu_detach_dev(struct omap_iommu_domain *omap_domain,
-   struct device *dev)
+  struct device *dev)
 {
struct omap_iommu *oiommu = dev_to_omap_iommu(dev);
struct omap_iommu_arch_data *arch_data = dev-archdata.iommu;
@@ -1076,7 +1075,7 @@ static void _omap_iommu_detach_dev(struct 
omap_iommu_domain *omap_domain,
 }
 
 static void omap_iommu_detach_dev(struct iommu_domain *domain,
-struct device *dev)
+ struct device *dev)
 {
struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
 
@@ -1137,7 +1136,7 @@ static void omap_iommu_domain_free(struct iommu_domain 
*domain)
 }
 
 static phys_addr_t omap_iommu_iova_to_phys(struct iommu_domain *domain,
- dma_addr_t da)
+  dma_addr_t da)
 {
struct omap_iommu_domain *omap_domain = to_omap_domain(domain);
struct omap_iommu *oiommu = omap_domain-iommu_dev;
@@ -1154,7 +1153,7 @@ static phys_addr_t omap_iommu_iova_to_phys(struct 
iommu_domain *domain,
ret = omap_iommu_translate(*pte, da, IOLARGE_MASK);
else
dev_err(dev, bogus pte 0x%x, da 0x%llx, *pte,
-   (unsigned long long)da);
+   (unsigned long long)da);
} else {
if (iopgd_is_section(*pgd))
ret = omap_iommu_translate(*pgd, da, IOSECTION_MASK);
@@ -1162,7 +1161,7 @@ static phys_addr_t omap_iommu_iova_to_phys(struct 
iommu_domain *domain,
ret = omap_iommu_translate(*pgd, da, IOSUPER_MASK);
else
dev_err(dev, bogus pgd 0x%x, da 0x%llx, *pgd,
-   (unsigned long long)da);
+   (unsigned long long)da);
}
 
return ret;
-- 
2.4.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 05/11] iommu/omap: Remove unused union fields

2015-07-20 Thread Suman Anna
There are couple of unions defined in the structures
iotlb_entry and cr_regs. There are no usage/references
to some of these union fields in the code, so clean
them up and simplify the structures.

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu.h | 23 +++
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/iommu/omap-iommu.h b/drivers/iommu/omap-iommu.h
index b6cc90b2ba41..5b98408c18bf 100644
--- a/drivers/iommu/omap-iommu.h
+++ b/drivers/iommu/omap-iommu.h
@@ -22,12 +22,7 @@ struct iotlb_entry {
u32 da;
u32 pa;
u32 pgsz, prsvd, valid;
-   union {
-   u16 ap;
-   struct {
-   u32 endian, elsz, mixed;
-   };
-   };
+   u32 endian, elsz, mixed;
 };
 
 struct omap_iommu {
@@ -54,20 +49,8 @@ struct omap_iommu {
 };
 
 struct cr_regs {
-   union {
-   struct {
-   u16 cam_l;
-   u16 cam_h;
-   };
-   u32 cam;
-   };
-   union {
-   struct {
-   u16 ram_l;
-   u16 ram_h;
-   };
-   u32 ram;
-   };
+   u32 cam;
+   u32 ram;
 };
 
 struct iotlb_lock {
-- 
2.4.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 08/11] iommu/omap: Use BIT(x) macros in omap-iopgtable.h

2015-07-20 Thread Suman Anna
Switch to using the BIT(x) macros in omap-iopgtable.h where
possible. This eliminates the following checkpatch check
warning:
CHECK: Prefer using the BIT macro

A couple of macros that used zero bit shifting are defined
directly to avoid the above warning on one of the macros.

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iopgtable.h | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/iommu/omap-iopgtable.h b/drivers/iommu/omap-iopgtable.h
index bfde5405f514..01a315227bf0 100644
--- a/drivers/iommu/omap-iopgtable.h
+++ b/drivers/iommu/omap-iopgtable.h
@@ -13,25 +13,27 @@
 #ifndef _OMAP_IOPGTABLE_H
 #define _OMAP_IOPGTABLE_H
 
+#include linux/bitops.h
+
 /*
  * L2 table address mask and size definitions.
  */
 #define IOPGD_SHIFT20
-#define IOPGD_SIZE (1UL  IOPGD_SHIFT)
+#define IOPGD_SIZE BIT(IOPGD_SHIFT)
 #define IOPGD_MASK (~(IOPGD_SIZE - 1))
 
 /*
  * section address mask and size definitions.
  */
 #define IOSECTION_SHIFT20
-#define IOSECTION_SIZE (1UL  IOSECTION_SHIFT)
+#define IOSECTION_SIZE BIT(IOSECTION_SHIFT)
 #define IOSECTION_MASK (~(IOSECTION_SIZE - 1))
 
 /*
  * supersection address mask and size definitions.
  */
 #define IOSUPER_SHIFT  24
-#define IOSUPER_SIZE   (1UL  IOSUPER_SHIFT)
+#define IOSUPER_SIZE   BIT(IOSUPER_SHIFT)
 #define IOSUPER_MASK   (~(IOSUPER_SIZE - 1))
 
 #define PTRS_PER_IOPGD (1UL  (32 - IOPGD_SHIFT))
@@ -41,14 +43,14 @@
  * small page address mask and size definitions.
  */
 #define IOPTE_SHIFT12
-#define IOPTE_SIZE (1UL  IOPTE_SHIFT)
+#define IOPTE_SIZE BIT(IOPTE_SHIFT)
 #define IOPTE_MASK (~(IOPTE_SIZE - 1))
 
 /*
  * large page address mask and size definitions.
  */
 #define IOLARGE_SHIFT  16
-#define IOLARGE_SIZE   (1UL  IOLARGE_SHIFT)
+#define IOLARGE_SIZE   BIT(IOLARGE_SHIFT)
 #define IOLARGE_MASK   (~(IOLARGE_SIZE - 1))
 
 #define PTRS_PER_IOPTE (1UL  (IOPGD_SHIFT - IOPTE_SHIFT))
@@ -72,16 +74,16 @@ static inline phys_addr_t omap_iommu_translate(u32 d, u32 
va, u32 mask)
 /*
  * some descriptor attributes.
  */
-#define IOPGD_TABLE(1  0)
-#define IOPGD_SECTION  (2  0)
-#define IOPGD_SUPER(1  18 | 2  0)
+#define IOPGD_TABLE(1)
+#define IOPGD_SECTION  (2)
+#define IOPGD_SUPER(BIT(18) | IOPGD_SECTION)
 
 #define iopgd_is_table(x)  (((x)  3) == IOPGD_TABLE)
 #define iopgd_is_section(x)(((x)  (1  18 | 3)) == IOPGD_SECTION)
 #define iopgd_is_super(x)  (((x)  (1  18 | 3)) == IOPGD_SUPER)
 
-#define IOPTE_SMALL(2  0)
-#define IOPTE_LARGE(1  0)
+#define IOPTE_SMALL(2)
+#define IOPTE_LARGE(1)
 
 #define iopte_is_small(x)  (((x)  2) == IOPTE_SMALL)
 #define iopte_is_large(x)  (((x)  3) == IOPTE_LARGE)
-- 
2.4.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 09/11] iommu/omap: Use BIT(x) macros in omap-iommu.h

2015-07-20 Thread Suman Anna
Switch to using the BIT(x) macros in omap-iommu.h where
possible. This eliminates the following checkpatch check
warning:
CHECK: Prefer using the BIT macro

A couple of the warnings were ignored for better readability
of the bit-shift for the different values.

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu.h | 28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/iommu/omap-iommu.h b/drivers/iommu/omap-iommu.h
index 5b98408c18bf..a656df2f9e03 100644
--- a/drivers/iommu/omap-iommu.h
+++ b/drivers/iommu/omap-iommu.h
@@ -13,6 +13,8 @@
 #ifndef _OMAP_IOMMU_H
 #define _OMAP_IOMMU_H
 
+#include linux/bitops.h
+
 #define for_each_iotlb_cr(obj, n, __i, cr) \
for (__i = 0;   \
 (__i  (n))  (cr = __iotlb_read_cr((obj), __i), true);   \
@@ -96,11 +98,11 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
  * MMU Register bit definitions
  */
 /* IRQSTATUS  IRQENABLE */
-#define MMU_IRQ_MULTIHITFAULT  (1  4)
-#define MMU_IRQ_TABLEWALKFAULT (1  3)
-#define MMU_IRQ_EMUMISS(1  2)
-#define MMU_IRQ_TRANSLATIONFAULT   (1  1)
-#define MMU_IRQ_TLBMISS(1  0)
+#define MMU_IRQ_MULTIHITFAULT  BIT(4)
+#define MMU_IRQ_TABLEWALKFAULT BIT(3)
+#define MMU_IRQ_EMUMISSBIT(2)
+#define MMU_IRQ_TRANSLATIONFAULT   BIT(1)
+#define MMU_IRQ_TLBMISSBIT(0)
 
 #define __MMU_IRQ_FAULT\
(MMU_IRQ_MULTIHITFAULT | MMU_IRQ_EMUMISS | MMU_IRQ_TRANSLATIONFAULT)
@@ -112,16 +114,16 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
 /* MMU_CNTL */
 #define MMU_CNTL_SHIFT 1
 #define MMU_CNTL_MASK  (7  MMU_CNTL_SHIFT)
-#define MMU_CNTL_EML_TLB   (1  3)
-#define MMU_CNTL_TWL_EN(1  2)
-#define MMU_CNTL_MMU_EN(1  1)
+#define MMU_CNTL_EML_TLB   BIT(3)
+#define MMU_CNTL_TWL_ENBIT(2)
+#define MMU_CNTL_MMU_ENBIT(1)
 
 /* CAM */
 #define MMU_CAM_VATAG_SHIFT12
 #define MMU_CAM_VATAG_MASK \
((~0UL  MMU_CAM_VATAG_SHIFT)  MMU_CAM_VATAG_SHIFT)
-#define MMU_CAM_P  (1  3)
-#define MMU_CAM_V  (1  2)
+#define MMU_CAM_P  BIT(3)
+#define MMU_CAM_V  BIT(2)
 #define MMU_CAM_PGSZ_MASK  3
 #define MMU_CAM_PGSZ_1M(0  0)
 #define MMU_CAM_PGSZ_64K   (1  0)
@@ -134,9 +136,9 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
((~0UL  MMU_RAM_PADDR_SHIFT)  MMU_RAM_PADDR_SHIFT)
 
 #define MMU_RAM_ENDIAN_SHIFT   9
-#define MMU_RAM_ENDIAN_MASK(1  MMU_RAM_ENDIAN_SHIFT)
+#define MMU_RAM_ENDIAN_MASKBIT(MMU_RAM_ENDIAN_SHIFT)
 #define MMU_RAM_ENDIAN_LITTLE  (0  MMU_RAM_ENDIAN_SHIFT)
-#define MMU_RAM_ENDIAN_BIG (1  MMU_RAM_ENDIAN_SHIFT)
+#define MMU_RAM_ENDIAN_BIG BIT(MMU_RAM_ENDIAN_SHIFT)
 
 #define MMU_RAM_ELSZ_SHIFT 7
 #define MMU_RAM_ELSZ_MASK  (3  MMU_RAM_ELSZ_SHIFT)
@@ -145,7 +147,7 @@ static inline struct omap_iommu *dev_to_omap_iommu(struct 
device *dev)
 #define MMU_RAM_ELSZ_32(2  MMU_RAM_ELSZ_SHIFT)
 #define MMU_RAM_ELSZ_NONE  (3  MMU_RAM_ELSZ_SHIFT)
 #define MMU_RAM_MIXED_SHIFT6
-#define MMU_RAM_MIXED_MASK (1  MMU_RAM_MIXED_SHIFT)
+#define MMU_RAM_MIXED_MASK BIT(MMU_RAM_MIXED_SHIFT)
 #define MMU_RAM_MIXED  MMU_RAM_MIXED_MASK
 
 #define MMU_GP_REG_BUS_ERR_BACK_EN 0x1
-- 
2.4.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 07/11] iommu/omap: Remove unnecessary error traces on alloc failures

2015-07-20 Thread Suman Anna
Fix couple of checkpatch warnings of the type,
WARNING: Possible unnecessary 'out of memory' message

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 0fc00f31c39d..4328d9855edb 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1093,16 +1093,12 @@ static struct iommu_domain 
*omap_iommu_domain_alloc(unsigned type)
return NULL;
 
omap_domain = kzalloc(sizeof(*omap_domain), GFP_KERNEL);
-   if (!omap_domain) {
-   pr_err(kzalloc failed\n);
+   if (!omap_domain)
goto out;
-   }
 
omap_domain-pgtable = kzalloc(IOPGD_TABLE_SIZE, GFP_KERNEL);
-   if (!omap_domain-pgtable) {
-   pr_err(kzalloc failed\n);
+   if (!omap_domain-pgtable)
goto fail_nomem;
-   }
 
/*
 * should never fail, but please keep this around to ensure
-- 
2.4.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 00/11] Some OMAP IOMMU cleanup patches

2015-07-20 Thread Suman Anna
Hi Joerg,

The following series includes minor cleanup patches and checkpatch
fixes to the OMAP IOMMU driver. The first 5 patches do some cleanup
and some debugfs code rearrangement, while the last 6 patches deal
with the stricter checkpatch warnings/checks.

The series is baselined on 4.2-rc3 and should apply fine on any 4.2-rc.

regards
Suman

Suman Anna (11):
  Documentation: dt: Add #iommu-cells info to OMAP iommu bindings
  iommu/omap: Remove all module references
  iommu/omap: Move debugfs functions to omap-iommu-debug.c
  iommu/omap: Protect omap-iopgtable.h against double inclusion
  iommu/omap: Remove unused union fields
  iommu/omap: Remove trailing semi-colon from a macro
  iommu/omap: Remove unnecessary error traces on alloc failures
  iommu/omap: Use BIT(x) macros in omap-iopgtable.h
  iommu/omap: Use BIT(x) macros in omap-iommu.h
  iommu/omap: Align code with open parenthesis
  iommu/omap: Split multiple assignments into separate lines

 .../devicetree/bindings/iommu/ti,omap-iommu.txt|   6 +
 drivers/iommu/omap-iommu-debug.c   | 113 +++-
 drivers/iommu/omap-iommu.c | 204 +++--
 drivers/iommu/omap-iommu.h |  79 
 drivers/iommu/omap-iopgtable.h |  27 ++-
 5 files changed, 197 insertions(+), 232 deletions(-)

-- 
2.4.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 11/11] iommu/omap: Split multiple assignments into separate lines

2015-07-20 Thread Suman Anna
Use separate assignments for assigning the same value into
different variables. This fixes the following check warning
generated with the checkpatch --strict option:
CHECK: multiple assignments should be avoided

Signed-off-by: Suman Anna s-a...@ti.com
---
 drivers/iommu/omap-iommu.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 36d0033c2ccb..fe742c01a4f2 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1044,7 +1044,8 @@ omap_iommu_attach_dev(struct iommu_domain *domain, struct 
device *dev)
goto out;
}
 
-   omap_domain-iommu_dev = arch_data-iommu_dev = oiommu;
+   omap_domain-iommu_dev = oiommu;
+   arch_data-iommu_dev = oiommu;
omap_domain-dev = dev;
oiommu-domain = domain;
 
@@ -1069,7 +1070,8 @@ static void _omap_iommu_detach_dev(struct 
omap_iommu_domain *omap_domain,
 
omap_iommu_detach(oiommu);
 
-   omap_domain-iommu_dev = arch_data-iommu_dev = NULL;
+   omap_domain-iommu_dev = NULL;
+   arch_data-iommu_dev = NULL;
omap_domain-dev = NULL;
oiommu-domain = NULL;
 }
-- 
2.4.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 01/11] Documentation: dt: Add #iommu-cells info to OMAP iommu bindings

2015-07-20 Thread Suman Anna
The OMAP IOMMU bindings is updated to reflect the required #iommu-cells
property.

Signed-off-by: Suman Anna s-a...@ti.com
---
 Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt 
b/Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt
index 42531dc387aa..869699925fd5 100644
--- a/Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt
+++ b/Documentation/devicetree/bindings/iommu/ti,omap-iommu.txt
@@ -8,6 +8,11 @@ Required properties:
 - ti,hwmods  : Name of the hwmod associated with the IOMMU instance
 - reg: Address space for the configuration registers
 - interrupts : Interrupt specifier for the IOMMU instance
+- #iommu-cells : Should be 0. OMAP IOMMUs are all single-master devices,
+ and needs no additional data in the pargs specifier. Please
+ also refer to the generic bindings document for more info
+ on this property,
+ Documentation/devicetree/bindings/iommu/iommu.txt
 
 Optional properties:
 - ti,#tlb-entries : Number of entries in the translation look-aside buffer.
@@ -18,6 +23,7 @@ Optional properties:
 Example:
/* OMAP3 ISP MMU */
mmu_isp: mmu@480bd400 {
+   #iommu-cells = 0;
compatible = ti,omap2-iommu;
reg = 0x480bd400 0x80;
interrupts = 24;
-- 
2.4.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 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes

2015-07-20 Thread Kishon Vijay Abraham I
Hi,

On Monday 20 July 2015 05:34 PM, Tero Kristo wrote:
 On 07/17/2015 04:47 PM, Roger Quadros wrote:
 scm_conf1 maps the control register address space after the
 padconf till the end.

 Fix the scm_conf and pmx_core resource lengths. We need to add
 4 bytes to include the last 32-bit register space.

 Remove the redundant dra7_ctrl_core and dra7_ctrl_general nodes.
 They are not used by anyone and no longer needed as they are
 covered by scm_conf and scm_conf1.
 
 Looks like you are doing three things in this patch, maybe split it up 
 as such?
 

 Signed-off-by: Roger Quadros rog...@ti.com
 ---
   arch/arm/boot/dts/dra7.dtsi | 19 ---
   1 file changed, 8 insertions(+), 11 deletions(-)

 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index 4a0718c..d07c34c 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -141,7 +141,7 @@
  dra7_pmx_core: pinmux@1400 {
  compatible = ti,dra7-padconf,
   pinctrl-single;
 -reg = 0x1400 0x0464;
 +reg = 0x1400 0x0468;
  #address-cells = 1;
  #size-cells = 0;
  #interrupt-cells = 1;
 @@ -149,6 +149,13 @@
  pinctrl-single,register-width = 32;
  pinctrl-single,function-mask = 
 0x3fff;
  };
 +
 +scm_conf1: scm_conf@1 {
 
 Should be ... scm_conf@1868?
 
 Are there any users for this area anyway? I don't think we should map 
 this area just for fun of it. Mostly it looks like this contains efuse 
 values for OPPs, which should be mapped from the OPP layer, not as a 
 generic syscon.

The last few registers are used for PCIe PHY and I'll be needing it for the
next version of my patch series.

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