Lines Matching refs:key
122 char key[5]; /* four-letter key code */ member
221 static int send_argument(const char *key) in send_argument() argument
226 if (send_byte(key[i], APPLESMC_DATA_PORT)) in send_argument()
231 static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) in read_smc() argument
236 if (send_command(cmd) || send_argument(key)) { in read_smc()
237 pr_warn("%.4s: read arg fail\n", key); in read_smc()
243 pr_warn("%.4s: read len fail\n", key); in read_smc()
249 pr_warn("%.4s: read data[%d] fail\n", key, i); in read_smc()
269 static int write_smc(u8 cmd, const char *key, const u8 *buffer, u8 len) in write_smc() argument
273 if (send_command(cmd) || send_argument(key)) { in write_smc()
274 pr_warn("%s: write arg fail\n", key); in write_smc()
279 pr_warn("%.4s: write len fail\n", key); in write_smc()
285 pr_warn("%s: write data fail\n", key); in write_smc()
321 ret = read_smc(APPLESMC_READ_CMD, entry->key, buf, len); in applesmc_read_entry()
335 ret = write_smc(APPLESMC_WRITE_CMD, entry->key, buf, len); in applesmc_write_entry()
343 u8 key[4], info[6]; in applesmc_get_entry_by_index() local
355 ret = read_smc(APPLESMC_GET_KEY_BY_INDEX_CMD, (u8 *)&be, key, 4); in applesmc_get_entry_by_index()
358 ret = read_smc(APPLESMC_GET_KEY_TYPE_CMD, key, info, 6); in applesmc_get_entry_by_index()
362 memcpy(cache->key, key, 4); in applesmc_get_entry_by_index()
375 static int applesmc_get_lower_bound(unsigned int *lo, const char *key) in applesmc_get_lower_bound() argument
387 if (strcmp(entry->key, key) < 0) in applesmc_get_lower_bound()
397 static int applesmc_get_upper_bound(unsigned int *hi, const char *key) in applesmc_get_upper_bound() argument
409 if (strcmp(key, entry->key) < 0) in applesmc_get_upper_bound()
419 static const struct applesmc_entry *applesmc_get_entry_by_key(const char *key) in applesmc_get_entry_by_key() argument
424 ret = applesmc_get_lower_bound(&begin, key); in applesmc_get_entry_by_key()
427 ret = applesmc_get_upper_bound(&end, key); in applesmc_get_entry_by_key()
436 static int applesmc_read_key(const char *key, u8 *buffer, u8 len) in applesmc_read_key() argument
440 entry = applesmc_get_entry_by_key(key); in applesmc_read_key()
447 static int applesmc_write_key(const char *key, const u8 *buffer, u8 len) in applesmc_write_key() argument
451 entry = applesmc_get_entry_by_key(key); in applesmc_write_key()
458 static int applesmc_has_key(const char *key, bool *value) in applesmc_has_key() argument
462 entry = applesmc_get_entry_by_key(key); in applesmc_has_key()
473 static int applesmc_read_s16(const char *key, s16 *value) in applesmc_read_s16() argument
478 ret = applesmc_read_key(key, buffer, 2); in applesmc_read_s16()
528 s->index[s->index_count++] = entry->key; in applesmc_init_index()
783 const char *key = smcreg.index[to_index(devattr)]; in applesmc_show_sensor_label() local
785 return snprintf(sysfsbuf, PAGE_SIZE, "%s\n", key); in applesmc_show_sensor_label()
792 const char *key = smcreg.index[to_index(devattr)]; in applesmc_show_temperature() local
797 ret = applesmc_read_s16(key, &value); in applesmc_show_temperature()
1015 return snprintf(sysfsbuf, PAGE_SIZE, "%s\n", entry->key); in applesmc_key_at_index_name_show()