Commit 70cd1c1a authored by Adam Wujek's avatar Adam Wujek

sw/patches/linux: make Monimod to use block transfers for UPTIME_SECS and TMR_ERROR_CNT

This change also make use of the PEC if enabled during the read of
UPTIME_SECS and TMR_ERROR_CNT registers.
Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 0e349038
Pipeline #3806 passed with stage
in 41 minutes and 44 seconds
......@@ -83,7 +83,7 @@ index 15f95dd4488c..2d9fef5c5300 100644
}
static const struct i2c_device_id monimod_id[] = {
@@ -62,6 +90,134 @@ static struct i2c_driver monimod_driver = {
@@ -62,6 +90,133 @@ static struct i2c_driver monimod_driver = {
module_i2c_driver(monimod_driver);
......@@ -105,14 +105,13 @@ index 15f95dd4488c..2d9fef5c5300 100644
+ NULL, "%llx\n");
+
+
+static int monimod_debugfs_get_dword(void *data, u64 *val)
+static int monimod_debugfs_get_block_dword(void *data, u64 *val)
+{
+ int rc;
+ struct pmbus_debugfs_entry *entry = data;
+ u8 tmp[4];
+
+ rc = i2c_smbus_read_i2c_block_data(entry->client, entry->reg,
+ sizeof(tmp), tmp);
+ rc = i2c_smbus_read_block_data(entry->client, entry->reg, tmp);
+ if (rc < 0)
+ return rc;
+
......@@ -120,8 +119,8 @@ index 15f95dd4488c..2d9fef5c5300 100644
+
+ return 0;
+}
+DEFINE_DEBUGFS_ATTRIBUTE(monimod_debugfs_ops_get_dword,
+ monimod_debugfs_get_dword, NULL, "%lld\n");
+DEFINE_DEBUGFS_ATTRIBUTE(monimod_debugfs_ops_get_block_dword,
+ monimod_debugfs_get_block_dword, NULL, "%lld\n");
+
+static ssize_t monimod_debugfs_get_fw_type(struct file *file, char __user *buf,
+ size_t count, loff_t *ppos)
......@@ -189,14 +188,14 @@ index 15f95dd4488c..2d9fef5c5300 100644
+ entries[idx].reg = MONIMOD_REG_UPTIME_SECS;
+ debugfs_create_file("uptime_secs", 0444, monimod_dir,
+ &entries[idx++],
+ &monimod_debugfs_ops_get_dword);
+ &monimod_debugfs_ops_get_block_dword);
+
+ /* Create debugfs entry for tmr_error_cnt */
+ entries[idx].client = client;
+ entries[idx].reg = MONIMOD_REG_TMR_ERROR_CNT;
+ debugfs_create_file("tmr_error_cnt", 0444, monimod_dir,
+ &entries[idx++],
+ &monimod_debugfs_ops_get_dword);
+ &monimod_debugfs_ops_get_block_dword);
+
+ /* Create debugfs entry for use_pec */
+ entries[idx].client = client;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment