Lines Matching full:rc

76 	int rc;  in q54sj108a2_debugfs_read()  local
86 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_OPERATION); in q54sj108a2_debugfs_read()
87 if (rc < 0) in q54sj108a2_debugfs_read()
88 return rc; in q54sj108a2_debugfs_read()
90 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
93 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_WRITE_PROTECT); in q54sj108a2_debugfs_read()
94 if (rc < 0) in q54sj108a2_debugfs_read()
95 return rc; in q54sj108a2_debugfs_read()
97 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
100 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_VOUT_OV_FAULT_RESPONSE); in q54sj108a2_debugfs_read()
101 if (rc < 0) in q54sj108a2_debugfs_read()
102 return rc; in q54sj108a2_debugfs_read()
104 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
107 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_IOUT_OC_FAULT_RESPONSE); in q54sj108a2_debugfs_read()
108 if (rc < 0) in q54sj108a2_debugfs_read()
109 return rc; in q54sj108a2_debugfs_read()
111 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
114 rc = i2c_smbus_read_byte_data(psu->client, PMBUS_REVISION); in q54sj108a2_debugfs_read()
115 if (rc < 0) in q54sj108a2_debugfs_read()
116 return rc; in q54sj108a2_debugfs_read()
118 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
121 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_ID, data); in q54sj108a2_debugfs_read()
122 if (rc < 0) in q54sj108a2_debugfs_read()
123 return rc; in q54sj108a2_debugfs_read()
126 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_MODEL, data); in q54sj108a2_debugfs_read()
127 if (rc < 0) in q54sj108a2_debugfs_read()
128 return rc; in q54sj108a2_debugfs_read()
131 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_REVISION, data); in q54sj108a2_debugfs_read()
132 if (rc < 0) in q54sj108a2_debugfs_read()
133 return rc; in q54sj108a2_debugfs_read()
136 rc = i2c_smbus_read_block_data(psu->client, PMBUS_MFR_LOCATION, data); in q54sj108a2_debugfs_read()
137 if (rc < 0) in q54sj108a2_debugfs_read()
138 return rc; in q54sj108a2_debugfs_read()
141 rc = i2c_smbus_read_byte_data(psu->client, READ_HISTORY_EVENT_NUMBER); in q54sj108a2_debugfs_read()
142 if (rc < 0) in q54sj108a2_debugfs_read()
143 return rc; in q54sj108a2_debugfs_read()
145 rc = snprintf(data, 3, "%02x", rc); in q54sj108a2_debugfs_read()
148 rc = i2c_smbus_read_block_data(psu->client, READ_HISTORY_EVENTS, data); in q54sj108a2_debugfs_read()
149 if (rc < 0) in q54sj108a2_debugfs_read()
150 return rc; in q54sj108a2_debugfs_read()
153 rc = res - data; in q54sj108a2_debugfs_read()
157 rc = i2c_smbus_read_block_data(psu->client, PMBUS_FLASH_KEY_WRITE, data); in q54sj108a2_debugfs_read()
158 if (rc < 0) in q54sj108a2_debugfs_read()
159 return rc; in q54sj108a2_debugfs_read()
162 rc = res - data; in q54sj108a2_debugfs_read()
169 data[rc] = '\n'; in q54sj108a2_debugfs_read()
170 rc += 2; in q54sj108a2_debugfs_read()
172 return simple_read_from_buffer(buf, count, ppos, data, rc); in q54sj108a2_debugfs_read()
180 ssize_t rc; in q54sj108a2_debugfs_write() local
185 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_WRITE_PROTECT, 0); in q54sj108a2_debugfs_write()
186 if (rc) in q54sj108a2_debugfs_write()
187 return rc; in q54sj108a2_debugfs_write()
191 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
192 if (rc < 0) in q54sj108a2_debugfs_write()
193 return rc; in q54sj108a2_debugfs_write()
195 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_OPERATION, dst_data); in q54sj108a2_debugfs_write()
196 if (rc < 0) in q54sj108a2_debugfs_write()
197 return rc; in q54sj108a2_debugfs_write()
201 rc = i2c_smbus_write_byte(psu->client, PMBUS_CLEAR_FAULTS); in q54sj108a2_debugfs_write()
202 if (rc < 0) in q54sj108a2_debugfs_write()
203 return rc; in q54sj108a2_debugfs_write()
211 rc = i2c_smbus_write_block_data(psu->client, PMBUS_FLASH_KEY_WRITE, 4, flash_key); in q54sj108a2_debugfs_write()
212 if (rc < 0) in q54sj108a2_debugfs_write()
213 return rc; in q54sj108a2_debugfs_write()
215 rc = i2c_smbus_write_byte(psu->client, STORE_DEFAULT_ALL); in q54sj108a2_debugfs_write()
216 if (rc < 0) in q54sj108a2_debugfs_write()
217 return rc; in q54sj108a2_debugfs_write()
221 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
222 if (rc < 0) in q54sj108a2_debugfs_write()
223 return rc; in q54sj108a2_debugfs_write()
225 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_VOUT_OV_FAULT_RESPONSE, dst_data); in q54sj108a2_debugfs_write()
226 if (rc < 0) in q54sj108a2_debugfs_write()
227 return rc; in q54sj108a2_debugfs_write()
231 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
232 if (rc < 0) in q54sj108a2_debugfs_write()
233 return rc; in q54sj108a2_debugfs_write()
235 rc = i2c_smbus_write_byte_data(psu->client, PMBUS_IOUT_OC_FAULT_RESPONSE, dst_data); in q54sj108a2_debugfs_write()
236 if (rc < 0) in q54sj108a2_debugfs_write()
237 return rc; in q54sj108a2_debugfs_write()
241 rc = i2c_smbus_write_byte(psu->client, ERASE_BLACKBOX_DATA); in q54sj108a2_debugfs_write()
242 if (rc < 0) in q54sj108a2_debugfs_write()
243 return rc; in q54sj108a2_debugfs_write()
247 rc = kstrtou8_from_user(buf, count, 0, &dst_data); in q54sj108a2_debugfs_write()
248 if (rc < 0) in q54sj108a2_debugfs_write()
249 return rc; in q54sj108a2_debugfs_write()
251 rc = i2c_smbus_write_byte_data(psu->client, SET_HISTORY_EVENT_OFFSET, dst_data); in q54sj108a2_debugfs_write()
252 if (rc < 0) in q54sj108a2_debugfs_write()
253 return rc; in q54sj108a2_debugfs_write()