sh: define CONFIG_DISPLAY_BOARDINFO to print board information
[oweals/u-boot.git] / include / cros_ec.h
index 0ad9d81243e08dee6b5d59ded615ce5071e871b1..ec7517c5ae27adf2423a13f5acddf9a80b125810 100644 (file)
@@ -81,7 +81,7 @@ int cros_ec_read_id(struct cros_ec_dev *dev, char *id, int maxlen);
  * @param scan         Place to put the scan results
  * @return 0 if ok, -1 on error
  */
-int cros_ec_scan_keyboard(struct cros_ec_dev *dev, struct mbkp_keyscan *scan);
+int cros_ec_scan_keyboard(struct udevice *dev, struct mbkp_keyscan *scan);
 
 /**
  * Read which image is currently running on the CROS-EC device.
@@ -125,7 +125,7 @@ int cros_ec_reboot(struct cros_ec_dev *dev, enum ec_reboot_cmd cmd,
  * @param dev          CROS-EC device
  * @return 0 if no interrupt is pending
  */
-int cros_ec_interrupt_pending(struct cros_ec_dev *dev);
+int cros_ec_interrupt_pending(struct udevice *dev);
 
 enum {
        CROS_EC_OK,
@@ -280,6 +280,17 @@ int cros_ec_flash_erase(struct cros_ec_dev *dev, uint32_t offset,
 int cros_ec_flash_read(struct cros_ec_dev *dev, uint8_t *data, uint32_t offset,
                    uint32_t size);
 
+/**
+ * Read back flash parameters
+ *
+ * This function reads back parameters of the flash as reported by the EC
+ *
+ * @param dev  Pointer to device
+ * @param info Pointer to output flash info struct
+ */
+int cros_ec_read_flashinfo(struct cros_ec_dev *dev,
+                         struct ec_response_flash_info *info);
+
 /**
  * Write data to the flash
  *
@@ -395,23 +406,11 @@ struct i2c_msg;
  * Tunnel an I2C transfer to the EC
  *
  * @param dev          CROS-EC device
+ * @param port         The remote port on EC to use
  * @param msg          List of messages to transfer
  * @param nmsgs                Number of messages to transfer
  */
-int cros_ec_i2c_tunnel(struct udevice *dev, struct i2c_msg *msg, int nmsgs);
-
-/*
- * Tunnel an I2C transfer to the EC
- *
- * @param dev          CROS-EC device
- * @param chip         Chip address (7-bit I2C address)
- * @param addr         Register address to read/write
- * @param alen         Length of register address in bytes
- * @param buffer       Buffer containing data to read/write
- * @param len          Length of buffer
- * @param is_read      1 if this is a read, 0 if this is a write
- */
-int cros_ec_i2c_xfer_old(struct cros_ec_dev *dev, uchar chip, uint addr,
-                        int alen, uchar *buffer, int len, int is_read);
+int cros_ec_i2c_tunnel(struct udevice *dev, int port, struct i2c_msg *msg,
+                      int nmsgs);
 
 #endif