Re: [PATCH 1/10] HDQ driver: Remove global pointer

2008-10-06 Thread Tony Lindgren
* Evgeniy Polyakov [EMAIL PROTECTED] [080925 14:41]:
 Hi.
 
 On Thu, Sep 25, 2008 at 12:19:44PM +0530, Gadiyar, Anand ([EMAIL PROTECTED]) 
 wrote:
  From: Madhusudhan Chikkature [EMAIL PROTECTED]
  
  This patch provides the necessary modifications to the driver to
  remove the global ptr hdq_data.
  
  Signed-off-by: Madhusudhan Chikkature [EMAIL PROTECTED]
 
 Looks ok, IA ck the whole serie.

Great, pushing to linux-omap tree.

Evgeniy, are these already in your queue for upstream?

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


Re: [PATCH 1/10] HDQ driver: Remove global pointer

2008-10-06 Thread Tony Lindgren
* Evgeniy Polyakov [EMAIL PROTECTED] [081006 12:36]:
 Hi.
 
 On Mon, Oct 06, 2008 at 12:17:06PM +0300, Tony Lindgren ([EMAIL PROTECTED]) 
 wrote:
  Great, pushing to linux-omap tree.
  
  Evgeniy, are these already in your queue for upstream?
 
 Not really, since I do not follow omap tree and will not be able to
 handle dependency there. Please push w1 part when appropriate changes in
 the arch tree are ready.

* Madhusudhan Chikkature [EMAIL PROTECTED] [081006 12:38]:

 These patches are against the L-o tree. We need to send the complete
driver patches against the LKML kernel tree to Evgeniy.

OK, Madhu, can you please do the patches against the mainline kernel
for Evgeniy?

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


Re: [PATCH 1/10] HDQ driver: Remove global pointer

2008-10-06 Thread Madhusudhan Chikkature

- Original Message - 
From: Tony Lindgren [EMAIL PROTECTED]
To: Evgeniy Polyakov [EMAIL PROTECTED]
Cc: Gadiyar, Anand [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
linux-omap@vger.kernel.org; Chikkature Rajashekar, Madhusudhan [EMAIL 
PROTECTED]
Sent: Monday, October 06, 2008 2:47 PM
Subject: Re: [PATCH 1/10] HDQ driver: Remove global pointer


* Evgeniy Polyakov [EMAIL PROTECTED] [080925 14:41]:
 Hi.
 
 On Thu, Sep 25, 2008 at 12:19:44PM +0530, Gadiyar, Anand ([EMAIL PROTECTED]) 
 wrote:
  From: Madhusudhan Chikkature [EMAIL PROTECTED]
  
  This patch provides the necessary modifications to the driver to
  remove the global ptr hdq_data.
  
  Signed-off-by: Madhusudhan Chikkature [EMAIL PROTECTED]
 
 Looks ok, IA ck the whole serie.
 
 Great, pushing to linux-omap tree.
 
 Evgeniy, are these already in your queue for upstream?

Tony,
These patches are against the L-o tree. We need to send the complete driver 
patches against the LKML kernel tree to Evgeniy.

Regards,
Madhu
 
 Tony
 

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


Re: [PATCH 1/10] HDQ driver: Remove global pointer

2008-10-06 Thread Madhusudhan Chikkature

- Original Message - 
From: Tony Lindgren [EMAIL PROTECTED]
To: Evgeniy Polyakov [EMAIL PROTECTED]
Cc: Gadiyar, Anand [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
linux-omap@vger.kernel.org; Chikkature Rajashekar, Madhusudhan [EMAIL 
PROTECTED]
Sent: Monday, October 06, 2008 4:01 PM
Subject: Re: [PATCH 1/10] HDQ driver: Remove global pointer


* Evgeniy Polyakov [EMAIL PROTECTED] [081006 12:36]:
 Hi.
 
 On Mon, Oct 06, 2008 at 12:17:06PM +0300, Tony Lindgren ([EMAIL PROTECTED]) 
 wrote:
  Great, pushing to linux-omap tree.
  
  Evgeniy, are these already in your queue for upstream?
 
 Not really, since I do not follow omap tree and will not be able to
 handle dependency there. Please push w1 part when appropriate changes in
 the arch tree are ready.
 
 * Madhusudhan Chikkature [EMAIL PROTECTED] [081006 12:38]:

 These patches are against the L-o tree. We need to send the complete
 driver patches against the LKML kernel tree to Evgeniy.
 
 OK, Madhu, can you please do the patches against the mainline kernel
 for Evgeniy?

I will create the patches and send them to Evgeniy.

Regards,
Madhu
 
 Tony
 

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


[PATCH 1/10] HDQ driver: Remove global pointer

2008-09-25 Thread Gadiyar, Anand
From: Madhusudhan Chikkature [EMAIL PROTECTED]

This patch provides the necessary modifications to the driver to
remove the global ptr hdq_data.

Signed-off-by: Madhusudhan Chikkature [EMAIL PROTECTED]
---
Sending this series on behalf of Madhu

 drivers/w1/masters/omap_hdq.c |  137 ++
 1 files changed, 72 insertions(+), 65 deletions(-)

Index: linux-omap-2.6/drivers/w1/masters/omap_hdq.c
===
--- linux-omap-2.6.orig/drivers/w1/masters/omap_hdq.c   2008-08-18 
14:48:26.0 +0530
+++ linux-omap-2.6/drivers/w1/masters/omap_hdq.c2008-09-23 
12:39:19.0 +0530
@@ -62,11 +62,9 @@ struct hdq_data {
spinlock_t  hdq_spinlock;
 };
 
-static struct hdq_data *hdq_data;
-
-static int omap_hdq_get(void);
-static int omap_hdq_put(void);
-static int omap_hdq_break(void);
+static int omap_hdq_get(struct hdq_data *hdq_data);
+static int omap_hdq_put(struct hdq_data *hdq_data);
+static int omap_hdq_break(struct hdq_data *hdq_data);
 
 static int __init omap_hdq_probe(struct platform_device *pdev);
 static int omap_hdq_remove(struct platform_device *pdev);
@@ -81,12 +79,13 @@ static struct platform_driver omap_hdq_d
},
 };
 
-static u8 omap_w1_read_byte(void *data);
-static void omap_w1_write_byte(void *data, u8 byte);
-static u8 omap_w1_reset_bus(void *data);
-static void omap_w1_search_bus(void *data, u8 search_type,
+static u8 omap_w1_read_byte(void *_hdq);
+static void omap_w1_write_byte(void *_hdq, u8 byte);
+static u8 omap_w1_reset_bus(void *_hdq);
+static void omap_w1_search_bus(void *_hdq, u8 search_type,
w1_slave_found_callback slave_found);
 
+
 static struct w1_bus_master omap_w1_master = {
.read_byte  = omap_w1_read_byte,
.write_byte = omap_w1_write_byte,
@@ -97,25 +96,25 @@ static struct w1_bus_master omap_w1_mast
 /*
  * HDQ register I/O routines
  */
-static inline u8
-hdq_reg_in(u32 offset)
+static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset)
 {
return omap_readb(hdq_data-hdq_base + offset);
 }
 
-static inline u8
-hdq_reg_out(u32 offset, u8 val)
+static inline u8 hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val)
 {
omap_writeb(val, hdq_data-hdq_base + offset);
+
return val;
 }
 
-static inline u8
-hdq_reg_merge(u32 offset, u8 val, u8 mask)
+static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, u32 offset,
+   u8 val, u8 mask)
 {
u8 new_val = (omap_readb(hdq_data-hdq_base + offset)  ~mask)
| (val  mask);
omap_writeb(new_val, hdq_data-hdq_base + offset);
+
return new_val;
 }
 
@@ -125,15 +124,15 @@ hdq_reg_merge(u32 offset, u8 val, u8 mas
  * HDQ_FLAG_CLEAR: wait until all bits in the flag are cleared.
  * return 0 on success and -ETIMEDOUT in the case of timeout.
  */
-static int
-hdq_wait_for_flag(u32 offset, u8 flag, u8 flag_set, u8 *status)
+static int hdq_wait_for_flag(struct hdq_data *hdq_data, u32 offset,
+   u8 flag, u8 flag_set, u8 *status)
 {
int ret = 0;
unsigned long timeout = jiffies + OMAP_HDQ_TIMEOUT;
 
if (flag_set == OMAP_HDQ_FLAG_CLEAR) {
/* wait for the flag clear */
-   while (((*status = hdq_reg_in(offset))  flag)
+   while (((*status = hdq_reg_in(hdq_data, offset))  flag)
 time_before(jiffies, timeout)) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
@@ -142,7 +141,7 @@ hdq_wait_for_flag(u32 offset, u8 flag, u
ret = -ETIMEDOUT;
} else if (flag_set == OMAP_HDQ_FLAG_SET) {
/* wait for the flag set */
-   while (!((*status = hdq_reg_in(offset))  flag)
+   while (!((*status = hdq_reg_in(hdq_data, offset))  flag)
 time_before(jiffies, timeout)) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
@@ -159,7 +158,7 @@ hdq_wait_for_flag(u32 offset, u8 flag, u
  * write out a byte and fill *status with HDQ_INT_STATUS
  */
 static int
-hdq_write_byte(u8 val, u8 *status)
+hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
 {
int ret;
u8 tmp_status;
@@ -169,15 +168,15 @@ hdq_write_byte(u8 val, u8 *status)
 
spin_lock_irqsave(hdq_data-hdq_spinlock, irqflags);
/* clear interrupt flags via a dummy read */
-   hdq_reg_in(OMAP_HDQ_INT_STATUS);
+   hdq_reg_in(hdq_data, OMAP_HDQ_INT_STATUS);
/* ISR loads it with new INT_STATUS */
hdq_data-hdq_irqstatus = 0;
spin_unlock_irqrestore(hdq_data-hdq_spinlock, irqflags);
 
-   hdq_reg_out(OMAP_HDQ_TX_DATA, val);
+   hdq_reg_out(hdq_data, OMAP_HDQ_TX_DATA, val);
 
/* set the GO bit */
-   hdq_reg_merge(OMAP_HDQ_CTRL_STATUS, OMAP_HDQ_CTRL_STATUS_GO,
+   

Re: [PATCH 1/10] HDQ driver: Remove global pointer

2008-09-25 Thread Felipe Balbi
On Thu, Sep 25, 2008 at 12:19:44PM +0530, ext Gadiyar, Anand wrote:
 From: Madhusudhan Chikkature [EMAIL PROTECTED]
 
 This patch provides the necessary modifications to the driver to
 remove the global ptr hdq_data.
 
 Signed-off-by: Madhusudhan Chikkature [EMAIL PROTECTED]

Acked-by: Felipe Balbi [EMAIL PROTECTED]

 ---
 Sending this series on behalf of Madhu
 
  drivers/w1/masters/omap_hdq.c |  137 
 ++
  1 files changed, 72 insertions(+), 65 deletions(-)
 
 Index: linux-omap-2.6/drivers/w1/masters/omap_hdq.c
 ===
 --- linux-omap-2.6.orig/drivers/w1/masters/omap_hdq.c 2008-08-18 
 14:48:26.0 +0530
 +++ linux-omap-2.6/drivers/w1/masters/omap_hdq.c  2008-09-23 
 12:39:19.0 +0530
 @@ -62,11 +62,9 @@ struct hdq_data {
   spinlock_t  hdq_spinlock;
  };
  
 -static struct hdq_data *hdq_data;
 -
 -static int omap_hdq_get(void);
 -static int omap_hdq_put(void);
 -static int omap_hdq_break(void);
 +static int omap_hdq_get(struct hdq_data *hdq_data);
 +static int omap_hdq_put(struct hdq_data *hdq_data);
 +static int omap_hdq_break(struct hdq_data *hdq_data);
  
  static int __init omap_hdq_probe(struct platform_device *pdev);
  static int omap_hdq_remove(struct platform_device *pdev);
 @@ -81,12 +79,13 @@ static struct platform_driver omap_hdq_d
   },
  };
  
 -static u8 omap_w1_read_byte(void *data);
 -static void omap_w1_write_byte(void *data, u8 byte);
 -static u8 omap_w1_reset_bus(void *data);
 -static void omap_w1_search_bus(void *data, u8 search_type,
 +static u8 omap_w1_read_byte(void *_hdq);
 +static void omap_w1_write_byte(void *_hdq, u8 byte);
 +static u8 omap_w1_reset_bus(void *_hdq);
 +static void omap_w1_search_bus(void *_hdq, u8 search_type,
   w1_slave_found_callback slave_found);
  
 +
  static struct w1_bus_master omap_w1_master = {
   .read_byte  = omap_w1_read_byte,
   .write_byte = omap_w1_write_byte,
 @@ -97,25 +96,25 @@ static struct w1_bus_master omap_w1_mast
  /*
   * HDQ register I/O routines
   */
 -static inline u8
 -hdq_reg_in(u32 offset)
 +static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset)
  {
   return omap_readb(hdq_data-hdq_base + offset);
  }
  
 -static inline u8
 -hdq_reg_out(u32 offset, u8 val)
 +static inline u8 hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val)
  {
   omap_writeb(val, hdq_data-hdq_base + offset);
 +
   return val;
  }
  
 -static inline u8
 -hdq_reg_merge(u32 offset, u8 val, u8 mask)
 +static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, u32 offset,
 + u8 val, u8 mask)
  {
   u8 new_val = (omap_readb(hdq_data-hdq_base + offset)  ~mask)
   | (val  mask);
   omap_writeb(new_val, hdq_data-hdq_base + offset);
 +
   return new_val;
  }
  
 @@ -125,15 +124,15 @@ hdq_reg_merge(u32 offset, u8 val, u8 mas
   * HDQ_FLAG_CLEAR: wait until all bits in the flag are cleared.
   * return 0 on success and -ETIMEDOUT in the case of timeout.
   */
 -static int
 -hdq_wait_for_flag(u32 offset, u8 flag, u8 flag_set, u8 *status)
 +static int hdq_wait_for_flag(struct hdq_data *hdq_data, u32 offset,
 + u8 flag, u8 flag_set, u8 *status)
  {
   int ret = 0;
   unsigned long timeout = jiffies + OMAP_HDQ_TIMEOUT;
  
   if (flag_set == OMAP_HDQ_FLAG_CLEAR) {
   /* wait for the flag clear */
 - while (((*status = hdq_reg_in(offset))  flag)
 + while (((*status = hdq_reg_in(hdq_data, offset))  flag)
time_before(jiffies, timeout)) {
   set_current_state(TASK_UNINTERRUPTIBLE);
   schedule_timeout(1);
 @@ -142,7 +141,7 @@ hdq_wait_for_flag(u32 offset, u8 flag, u
   ret = -ETIMEDOUT;
   } else if (flag_set == OMAP_HDQ_FLAG_SET) {
   /* wait for the flag set */
 - while (!((*status = hdq_reg_in(offset))  flag)
 + while (!((*status = hdq_reg_in(hdq_data, offset))  flag)
time_before(jiffies, timeout)) {
   set_current_state(TASK_UNINTERRUPTIBLE);
   schedule_timeout(1);
 @@ -159,7 +158,7 @@ hdq_wait_for_flag(u32 offset, u8 flag, u
   * write out a byte and fill *status with HDQ_INT_STATUS
   */
  static int
 -hdq_write_byte(u8 val, u8 *status)
 +hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
  {
   int ret;
   u8 tmp_status;
 @@ -169,15 +168,15 @@ hdq_write_byte(u8 val, u8 *status)
  
   spin_lock_irqsave(hdq_data-hdq_spinlock, irqflags);
   /* clear interrupt flags via a dummy read */
 - hdq_reg_in(OMAP_HDQ_INT_STATUS);
 + hdq_reg_in(hdq_data, OMAP_HDQ_INT_STATUS);
   /* ISR loads it with new INT_STATUS */
   hdq_data-hdq_irqstatus = 0;
   spin_unlock_irqrestore(hdq_data-hdq_spinlock, irqflags);
  
 - hdq_reg_out(OMAP_HDQ_TX_DATA, val);
 + 

Re: [PATCH 1/10] HDQ driver: Remove global pointer

2008-09-25 Thread Evgeniy Polyakov
Hi.

On Thu, Sep 25, 2008 at 12:19:44PM +0530, Gadiyar, Anand ([EMAIL PROTECTED]) 
wrote:
 From: Madhusudhan Chikkature [EMAIL PROTECTED]
 
 This patch provides the necessary modifications to the driver to
 remove the global ptr hdq_data.
 
 Signed-off-by: Madhusudhan Chikkature [EMAIL PROTECTED]

Looks ok, IA ck the whole serie.
Thank you.

-- 
Evgeniy Polyakov
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html