<div dir="ltr"><div><div>Kindly ignore this.  I have rebased and pushed all the changes in one patch. <br><br></div>Thanks<br></div>Mudit </div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 20, 2016 at 6:55 PM, Mudit Jain <span dir="ltr"><<a href="mailto:muditjain18011995@gmail.com" target="_blank">muditjain18011995@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Mudit Jain <<a href="mailto:muditj@nvidia.com">muditj@nvidia.com</a>><br>
<br>
---<br>
 c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h      |  2 ++<br>
 c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c         | 25 ++++++++++++++++++++++<br>
 c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h | 12 +++++++++++<br>
 3 files changed, 39 insertions(+)<br>
<br>
diff --git a/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h b/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h<br>
index d3408f9..74f7557 100644<br>
--- a/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h<br>
+++ b/c/src/lib/libbsp/arm/<wbr>raspberrypi/include/vc.h<br>
@@ -106,6 +106,8 @@ typedef struct {<br>
 #define BCM2835_MAILBOX_POWER_STATE_<wbr>NODEV ( 1 << 1 )<br>
 int bcm2835_mailbox_set_power_<wbr>state( bcm2835_set_power_state_<wbr>entries *_entries );<br>
<br>
+int bcm2835_mailbox_get_power_<wbr>state( bcm2835_set_power_state_<wbr>entries *_entries );<br>
+<br>
 typedef struct {<br>
   uint32_t base;<br>
   size_t size;<br>
diff --git a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c<br>
index 53ac1e8..c089b36 100644<br>
--- a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c<br>
+++ b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc.c<br>
@@ -254,6 +254,31 @@ int bcm2835_mailbox_get_cmdline( bcm2835_get_cmdline_entries *_entries )<br>
   return 0;<br>
 }<br>
<br>
+int bcm2835_mailbox_get_power_<wbr>state( bcm2835_set_power_state_<wbr>entries *_entries )<br>
+{<br>
+  struct {<br>
+    bcm2835_mbox_buf_hdr hdr;<br>
+    bcm2835_mbox_tag_get_power_<wbr>state get_power_state;<br>
+    uint32_t end_tag;<br>
+  } buffer BCM2835_MBOX_BUF_ALIGN_<wbr>ATTRIBUTE;<br>
+  BCM2835_MBOX_INIT_BUF( &buffer );<br>
+  BCM2835_MBOX_INIT_TAG( &buffer.get_power_state,<br>
+    BCM2835_MAILBOX_TAG_GET_POWER_<wbr>STATE );<br>
+  buffer.get_power_state.body.<wbr>req.dev_id = _entries->dev_id;<br>
+  bcm2835_mailbox_buffer_flush_<wbr>and_invalidate( &buffer, sizeof( &buffer ) );<br>
+<br>
+  if ( bcm2835_mailbox_send_read_<wbr>buffer( &buffer ) )<br>
+    return -1;<br>
+<br>
+  _entries->dev_id = buffer.get_power_state.body.<wbr>resp.dev_id;<br>
+  _entries->state = buffer.get_power_state.body.<wbr>resp.state;<br>
+<br>
+  if ( !bcm2835_mailbox_buffer_<wbr>suceeded( &buffer.hdr ) )<br>
+    return -2;<br>
+<br>
+  return 0;<br>
+}<br>
+<br>
 int bcm2835_mailbox_set_power_<wbr>state( bcm2835_set_power_state_<wbr>entries *_entries )<br>
 {<br>
   struct {<br>
diff --git a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h<br>
index 516f8f4..e1a5a5b 100644<br>
--- a/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h<br>
+++ b/c/src/lib/libbsp/arm/<wbr>raspberrypi/misc/vc_defines.h<br>
@@ -246,6 +246,18 @@ typedef struct {<br>
 #define BCM2835_MAILBOX_POWER_UDID_<wbr>CCP2TX            0x00000008<br>
<br>
 #define BCM2835_MAILBOX_TAG_GET_POWER_<wbr>STATE     0x00020001<br>
+typedef struct {<br>
+  bcm2835_mbox_tag_hdr tag_hdr;<br>
+  union {<br>
+    struct {<br>
+      uint32_t dev_id;<br>
+    } req;<br>
+    struct {<br>
+      uint32_t dev_id;<br>
+      uint32_t state;<br>
+    } resp;<br>
+  } body;<br>
+} bcm2835_mbox_tag_get_power_<wbr>state;<br>
<br>
 #define BCM2835_MAILBOX_POWER_STATE_<wbr>RESP_ON       (1 << 0)<br>
 #define BCM2835_MAILBOX_POWER_STATE_<wbr>RESP_NODEV    (1 << 1)<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
</font></span></blockquote></div><br></div>