read/write chromeos vbc with sysfs
[cascardo/linux.git] / drivers / platform / chromeos.c
index 199ad97..e317da0 100644 (file)
@@ -28,7 +28,6 @@
 
 static struct chromeos_vbc *chromeos_vbc_ptr;
 
-static int vbc_read(u8 *buf, int buf_size);
 static int vbc_write_byte(unsigned offset, u8 value);
 
 /* the following defines are copied from
@@ -72,6 +71,11 @@ static u8 crc8(const u8 *data, int len)
        return (u8)(crc >> 8);
 }
 
+int chromeos_vbc_write(const u8 *buf, ssize_t size)
+{
+       return chromeos_vbc_ptr->write(buf, size);
+}
+
 static int vbc_write_byte(unsigned offset, u8 value)
 {
        u8 buf[MAX_VBOOT_CONTEXT_BUFFER_SIZE];
@@ -80,7 +84,7 @@ static int vbc_write_byte(unsigned offset, u8 value)
        if (!chromeos_vbc_ptr)
                return -ENOSYS;
 
-       size = vbc_read(buf, sizeof(buf));
+       size = chromeos_vbc_read(buf, sizeof(buf));
        if (size <= 0)
                return -EINVAL;
 
@@ -101,7 +105,7 @@ static int vbc_write_byte(unsigned offset, u8 value)
  * of bytes in the vboot context buffer, -1 on any error (uninitialized
  * subsystem, corrupted crc8 value, not enough room in the buffer, etc.).
  */
-static int vbc_read(u8 *buf, int buf_size)
+int chromeos_vbc_read(u8 *buf, int buf_size)
 {
        ssize_t size;