Add wistron oem command to detect riser-f
PNOR needs to know whether riser-f is present when poweron, so we add
an oem command to detect whether riser-f is present.
The result will return two bytes of data, the first byte is bus9 and
the second byte is bus10.
Return data will have 0x00 or 0x01.
0x00 means riser-f not present
0x01 means riser-f present
Change-Id: I7d932b8e69b820b67466b83998d5bd3b8c472720
Signed-off-by: Ben Pai <Ben_Pai@wistron.com>
diff --git a/smbus.hpp b/smbus.hpp
new file mode 100644
index 0000000..73e3e7e
--- /dev/null
+++ b/smbus.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+namespace phosphor
+{
+namespace smbus
+{
+
+class Smbus
+{
+ public:
+ Smbus(){};
+
+ int open_i2c_dev(int i2cbus, char* filename, size_t size, int quiet);
+
+ int smbusInit(int smbus_num);
+
+ int set_slave_addr(int file, int address, int force);
+
+ int SetSmbusCmdByte(int smbus_num, int8_t device_addr, int8_t smbuscmd,
+ int8_t data);
+
+ int GetSmbusCmdByte(int smbus_num, int8_t device_addr, int8_t smbuscmd);
+
+ void smbusClose(int smbus_num);
+};
+
+} // namespace smbus
+} // namespace phosphor