Lines Matching full:rc

75 	int rc;  in q54sj108a2_debugfs_read()  local
85 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_OPERATION); in q54sj108a2_debugfs_read()
86 if (rc < 0) in q54sj108a2_debugfs_read()
87 return rc; in q54sj108a2_debugfs_read()
89 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
92 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_WRITE_PROTECT); in q54sj108a2_debugfs_read()
93 if (rc < 0) in q54sj108a2_debugfs_read()
94 return rc; in q54sj108a2_debugfs_read()
96 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
99 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_VOUT_OV_FAULT_RESPONSE); in q54sj108a2_debugfs_read()
100 if (rc < 0) in q54sj108a2_debugfs_read()
101 return rc; in q54sj108a2_debugfs_read()
103 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
106 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_IOUT_OC_FAULT_RESPONSE); in q54sj108a2_debugfs_read()
107 if (rc < 0) in q54sj108a2_debugfs_read()
108 return rc; in q54sj108a2_debugfs_read()
110 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
113 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_REVISION); in q54sj108a2_debugfs_read()
114 if (rc < 0) in q54sj108a2_debugfs_read()
115 return rc; in q54sj108a2_debugfs_read()
117 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
120 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_ID, data); in q54sj108a2_debugfs_read()
121 if (rc < 0) in q54sj108a2_debugfs_read()
122 return rc; in q54sj108a2_debugfs_read()
125 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_MODEL, data); in q54sj108a2_debugfs_read()
126 if (rc < 0) in q54sj108a2_debugfs_read()
127 return rc; in q54sj108a2_debugfs_read()
130 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_REVISION, data); in q54sj108a2_debugfs_read()
131 if (rc < 0) in q54sj108a2_debugfs_read()
132 return rc; in q54sj108a2_debugfs_read()
135 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_LOCATION, data); in q54sj108a2_debugfs_read()
136 if (rc < 0) in q54sj108a2_debugfs_read()
137 return rc; in q54sj108a2_debugfs_read()
140 rc = i2c_smbus_read_byte_data(psu->client, READ_HISTORY_EVENT_NUMBER); in q54sj108a2_debugfs_read()
141 if (rc < 0) in q54sj108a2_debugfs_read()
142 return rc; in q54sj108a2_debugfs_read()
144 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
147 rc = i2c_smbus_read_block_data(psu->client, READ_HISTORY_EVENTS, data); in q54sj108a2_debugfs_read()
148 if (rc < 0) in q54sj108a2_debugfs_read()
149 return rc; in q54sj108a2_debugfs_read()
152 rc = res - data; in q54sj108a2_debugfs_read()
156 rc = i2c_smbus_read_block_data(psu->client, PMBUS_FLASH_KEY_WRITE, data); in q54sj108a2_debugfs_read()
157 if (rc < 0) in q54sj108a2_debugfs_read()
158 return rc; in q54sj108a2_debugfs_read()
161 rc = res - data; in q54sj108a2_debugfs_read()
168 data[rc] = '\n'; in q54sj108a2_debugfs_read()
169 rc += 2; in q54sj108a2_debugfs_read()
171 return simple_read_from_buffer(buf, count, ppos, data, rc); in q54sj108a2_debugfs_read()
179 ssize_t rc; in q54sj108a2_debugfs_write() local
184 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_WRITE_PROTECT, 0); in q54sj108a2_debugfs_write()
185 if (rc) in q54sj108a2_debugfs_write()
186 return rc; in q54sj108a2_debugfs_write()
190 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
191 if (rc < 0) in q54sj108a2_debugfs_write()
192 return rc; in q54sj108a2_debugfs_write()
194 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_OPERATION, dst_data); in q54sj108a2_debugfs_write()
195 if (rc < 0) in q54sj108a2_debugfs_write()
196 return rc; in q54sj108a2_debugfs_write()
200 rc = i2c_smbus_write_byte(psu->client, PMBUS_CLEAR_FAULTS); in q54sj108a2_debugfs_write()
201 if (rc < 0) in q54sj108a2_debugfs_write()
202 return rc; in q54sj108a2_debugfs_write()
210 rc = i2c_smbus_write_block_data(psu->client, PMBUS_FLASH_KEY_WRITE, 4, flash_key); in q54sj108a2_debugfs_write()
211 if (rc < 0) in q54sj108a2_debugfs_write()
212 return rc; in q54sj108a2_debugfs_write()
214 rc = i2c_smbus_write_byte(psu->client, STORE_DEFAULT_ALL); in q54sj108a2_debugfs_write()
215 if (rc < 0) in q54sj108a2_debugfs_write()
216 return rc; in q54sj108a2_debugfs_write()
220 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
221 if (rc < 0) in q54sj108a2_debugfs_write()
222 return rc; in q54sj108a2_debugfs_write()
224 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_VOUT_OV_FAULT_RESPONSE, dst_data); in q54sj108a2_debugfs_write()
225 if (rc < 0) in q54sj108a2_debugfs_write()
226 return rc; in q54sj108a2_debugfs_write()
230 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
231 if (rc < 0) in q54sj108a2_debugfs_write()
232 return rc; in q54sj108a2_debugfs_write()
234 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_IOUT_OC_FAULT_RESPONSE, dst_data); in q54sj108a2_debugfs_write()
235 if (rc < 0) in q54sj108a2_debugfs_write()
236 return rc; in q54sj108a2_debugfs_write()
240 rc = i2c_smbus_write_byte(psu->client, ERASE_BLACKBOX_DATA); in q54sj108a2_debugfs_write()
241 if (rc < 0) in q54sj108a2_debugfs_write()
242 return rc; in q54sj108a2_debugfs_write()
246 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
247 if (rc < 0) in q54sj108a2_debugfs_write()
248 return rc; in q54sj108a2_debugfs_write()
250 rc = i2c_smbus_write_byte_data(psu->client, SET_HISTORY_EVENT_OFFSET, dst_data); in q54sj108a2_debugfs_write()
251 if (rc < 0) in q54sj108a2_debugfs_write()
252 return rc; in q54sj108a2_debugfs_write()