Lines Matching refs:buffer
231 static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) in read_smc() argument
252 buffer[i] = inb(APPLESMC_DATA_PORT); in read_smc()
269 static int write_smc(u8 cmd, const char *key, const u8 *buffer, u8 len) in write_smc() argument
284 if (send_byte(buffer[i], APPLESMC_DATA_PORT)) { in write_smc()
436 static int applesmc_read_key(const char *key, u8 *buffer, u8 len) in applesmc_read_key() argument
444 return applesmc_read_entry(entry, buffer, len); in applesmc_read_key()
447 static int applesmc_write_key(const char *key, const u8 *buffer, u8 len) in applesmc_write_key() argument
455 return applesmc_write_entry(entry, buffer, len); in applesmc_write_key()
475 u8 buffer[2]; in applesmc_read_s16() local
478 ret = applesmc_read_key(key, buffer, 2); in applesmc_read_s16()
482 *value = ((s16)buffer[0] << 8) | buffer[1]; in applesmc_read_s16()
492 u8 buffer[2]; in applesmc_device_init() local
498 if (!applesmc_read_key(MOTION_SENSOR_KEY, buffer, 2) && in applesmc_device_init()
499 (buffer[0] != 0x00 || buffer[1] != 0x00)) in applesmc_device_init()
501 buffer[0] = 0xe0; in applesmc_device_init()
502 buffer[1] = 0x00; in applesmc_device_init()
503 applesmc_write_key(MOTION_SENSOR_KEY, buffer, 2); in applesmc_device_init()
748 u8 buffer[10]; in applesmc_light_show() local
760 ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, data_length); in applesmc_light_show()
763 left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2; in applesmc_light_show()
766 left = buffer[2]; in applesmc_light_show()
769 ret = applesmc_read_key(LIGHT_SENSOR_RIGHT_KEY, buffer, data_length); in applesmc_light_show()
770 right = buffer[2]; in applesmc_light_show()
812 u8 buffer[2]; in applesmc_show_fan_speed() local
816 ret = applesmc_read_key(newkey, buffer, 2); in applesmc_show_fan_speed()
817 speed = ((buffer[0] << 8 | buffer[1]) >> 2); in applesmc_show_fan_speed()
832 u8 buffer[2]; in applesmc_store_fan_speed() local
839 buffer[0] = (speed >> 6) & 0xff; in applesmc_store_fan_speed()
840 buffer[1] = (speed << 2) & 0xff; in applesmc_store_fan_speed()
841 ret = applesmc_write_key(newkey, buffer, 2); in applesmc_store_fan_speed()
854 u8 buffer[2]; in applesmc_show_fan_manual() local
856 ret = applesmc_read_key(FANS_MANUAL, buffer, 2); in applesmc_show_fan_manual()
857 manual = ((buffer[0] << 8 | buffer[1]) >> to_index(attr)) & 0x01; in applesmc_show_fan_manual()
870 u8 buffer[2]; in applesmc_store_fan_manual() local
877 ret = applesmc_read_key(FANS_MANUAL, buffer, 2); in applesmc_store_fan_manual()
878 val = (buffer[0] << 8 | buffer[1]); in applesmc_store_fan_manual()
887 buffer[0] = (val >> 8) & 0xFF; in applesmc_store_fan_manual()
888 buffer[1] = val & 0xFF; in applesmc_store_fan_manual()
890 ret = applesmc_write_key(FANS_MANUAL, buffer, 2); in applesmc_store_fan_manual()
904 u8 buffer[17]; in applesmc_show_fan_position() local
908 ret = applesmc_read_key(newkey, buffer, 16); in applesmc_show_fan_position()
909 buffer[16] = 0; in applesmc_show_fan_position()
914 return snprintf(sysfsbuf, PAGE_SIZE, "%s\n", buffer+4); in applesmc_show_fan_position()
953 u8 buffer[4]; in applesmc_key_count_show() local
956 ret = applesmc_read_key(KEY_COUNT_KEY, buffer, 4); in applesmc_key_count_show()
957 count = ((u32)buffer[0]<<24) + ((u32)buffer[1]<<16) + in applesmc_key_count_show()
958 ((u32)buffer[2]<<8) + buffer[3]; in applesmc_key_count_show()