Lines Matching refs:request
684 struct mlxbf_i2c_smbus_request *request) in mlxbf_i2c_smbus_start_transaction() argument
697 if (request->operation_cnt > MLXBF_I2C_SMBUS_MAX_OP_CNT) in mlxbf_i2c_smbus_start_transaction()
708 slave = request->slave & GENMASK(6, 0); in mlxbf_i2c_smbus_start_transaction()
738 for (op_idx = 0; op_idx < request->operation_cnt; op_idx++) { in mlxbf_i2c_smbus_start_transaction()
739 operation = &request->operation[op_idx]; in mlxbf_i2c_smbus_start_transaction()
839 mlxbf_i2c_smbus_quick_command(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_quick_command() argument
842 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_1; in mlxbf_i2c_smbus_quick_command()
844 request->operation[0].length = 0; in mlxbf_i2c_smbus_quick_command()
845 request->operation[0].flags = MLXBF_I2C_F_WRITE; in mlxbf_i2c_smbus_quick_command()
846 request->operation[0].flags |= read ? MLXBF_I2C_F_READ : 0; in mlxbf_i2c_smbus_quick_command()
849 static void mlxbf_i2c_smbus_byte_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_byte_func() argument
852 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_1; in mlxbf_i2c_smbus_byte_func()
854 request->operation[0].length = 1; in mlxbf_i2c_smbus_byte_func()
855 request->operation[0].length += pec_check; in mlxbf_i2c_smbus_byte_func()
857 request->operation[0].flags = MLXBF_I2C_F_SMBUS_OPERATION; in mlxbf_i2c_smbus_byte_func()
858 request->operation[0].flags |= read ? in mlxbf_i2c_smbus_byte_func()
860 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_byte_func()
862 request->operation[0].buffer = data; in mlxbf_i2c_smbus_byte_func()
866 mlxbf_i2c_smbus_data_byte_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_data_byte_func() argument
869 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2; in mlxbf_i2c_smbus_data_byte_func()
871 request->operation[0].length = 1; in mlxbf_i2c_smbus_data_byte_func()
872 request->operation[0].flags = in mlxbf_i2c_smbus_data_byte_func()
874 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_data_byte_func()
875 request->operation[0].buffer = command; in mlxbf_i2c_smbus_data_byte_func()
877 request->operation[1].length = 1; in mlxbf_i2c_smbus_data_byte_func()
878 request->operation[1].length += pec_check; in mlxbf_i2c_smbus_data_byte_func()
879 request->operation[1].flags = read ? in mlxbf_i2c_smbus_data_byte_func()
881 request->operation[1].buffer = data; in mlxbf_i2c_smbus_data_byte_func()
885 mlxbf_i2c_smbus_data_word_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_data_word_func() argument
888 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2; in mlxbf_i2c_smbus_data_word_func()
890 request->operation[0].length = 1; in mlxbf_i2c_smbus_data_word_func()
891 request->operation[0].flags = in mlxbf_i2c_smbus_data_word_func()
893 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_data_word_func()
894 request->operation[0].buffer = command; in mlxbf_i2c_smbus_data_word_func()
896 request->operation[1].length = 2; in mlxbf_i2c_smbus_data_word_func()
897 request->operation[1].length += pec_check; in mlxbf_i2c_smbus_data_word_func()
898 request->operation[1].flags = read ? in mlxbf_i2c_smbus_data_word_func()
900 request->operation[1].buffer = data; in mlxbf_i2c_smbus_data_word_func()
904 mlxbf_i2c_smbus_i2c_block_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_i2c_block_func() argument
908 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2; in mlxbf_i2c_smbus_i2c_block_func()
910 request->operation[0].length = 1; in mlxbf_i2c_smbus_i2c_block_func()
911 request->operation[0].flags = in mlxbf_i2c_smbus_i2c_block_func()
913 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_i2c_block_func()
914 request->operation[0].buffer = command; in mlxbf_i2c_smbus_i2c_block_func()
917 request->operation[0].flags |= MLXBF_I2C_F_WRITE_WITHOUT_STOP; in mlxbf_i2c_smbus_i2c_block_func()
924 request->operation[1].length = in mlxbf_i2c_smbus_i2c_block_func()
927 request->operation[1].flags = read ? in mlxbf_i2c_smbus_i2c_block_func()
933 request->operation[1].buffer = data + 1; in mlxbf_i2c_smbus_i2c_block_func()
935 *data_len = request->operation[1].length; in mlxbf_i2c_smbus_i2c_block_func()
942 static void mlxbf_i2c_smbus_block_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_block_func() argument
946 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2; in mlxbf_i2c_smbus_block_func()
948 request->operation[0].length = 1; in mlxbf_i2c_smbus_block_func()
949 request->operation[0].flags = in mlxbf_i2c_smbus_block_func()
951 request->operation[0].flags |= MLXBF_I2C_F_SMBUS_BLOCK; in mlxbf_i2c_smbus_block_func()
952 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_block_func()
953 request->operation[0].buffer = command; in mlxbf_i2c_smbus_block_func()
955 request->operation[1].length = in mlxbf_i2c_smbus_block_func()
958 request->operation[1].flags = read ? in mlxbf_i2c_smbus_block_func()
960 request->operation[1].buffer = data + 1; in mlxbf_i2c_smbus_block_func()
962 *data_len = request->operation[1].length; in mlxbf_i2c_smbus_block_func()
970 mlxbf_i2c_smbus_process_call_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_process_call_func() argument
973 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_3; in mlxbf_i2c_smbus_process_call_func()
975 request->operation[0].length = 1; in mlxbf_i2c_smbus_process_call_func()
976 request->operation[0].flags = in mlxbf_i2c_smbus_process_call_func()
978 request->operation[0].flags |= MLXBF_I2C_F_SMBUS_BLOCK; in mlxbf_i2c_smbus_process_call_func()
979 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_process_call_func()
980 request->operation[0].buffer = command; in mlxbf_i2c_smbus_process_call_func()
982 request->operation[1].length = 2; in mlxbf_i2c_smbus_process_call_func()
983 request->operation[1].flags = MLXBF_I2C_F_WRITE; in mlxbf_i2c_smbus_process_call_func()
984 request->operation[1].buffer = data; in mlxbf_i2c_smbus_process_call_func()
986 request->operation[2].length = 3; in mlxbf_i2c_smbus_process_call_func()
987 request->operation[2].flags = MLXBF_I2C_F_READ; in mlxbf_i2c_smbus_process_call_func()
988 request->operation[2].buffer = data; in mlxbf_i2c_smbus_process_call_func()
992 mlxbf_i2c_smbus_blk_process_call_func(struct mlxbf_i2c_smbus_request *request, in mlxbf_i2c_smbus_blk_process_call_func() argument
998 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_3; in mlxbf_i2c_smbus_blk_process_call_func()
1000 request->operation[0].length = 1; in mlxbf_i2c_smbus_blk_process_call_func()
1001 request->operation[0].flags = in mlxbf_i2c_smbus_blk_process_call_func()
1003 request->operation[0].flags |= MLXBF_I2C_F_SMBUS_BLOCK; in mlxbf_i2c_smbus_blk_process_call_func()
1004 request->operation[0].flags |= (pec_check) ? MLXBF_I2C_F_SMBUS_PEC : 0; in mlxbf_i2c_smbus_blk_process_call_func()
1005 request->operation[0].buffer = command; in mlxbf_i2c_smbus_blk_process_call_func()
1010 request->operation[1].length = length - pec_check; in mlxbf_i2c_smbus_blk_process_call_func()
1011 request->operation[1].flags = MLXBF_I2C_F_WRITE; in mlxbf_i2c_smbus_blk_process_call_func()
1012 request->operation[1].buffer = data; in mlxbf_i2c_smbus_blk_process_call_func()
1014 request->operation[2].length = length; in mlxbf_i2c_smbus_blk_process_call_func()
1015 request->operation[2].flags = MLXBF_I2C_F_READ; in mlxbf_i2c_smbus_blk_process_call_func()
1016 request->operation[2].buffer = data; in mlxbf_i2c_smbus_blk_process_call_func()
2035 struct mlxbf_i2c_smbus_request request = { 0 }; in mlxbf_i2c_smbus_xfer() local
2040 request.slave = addr; in mlxbf_i2c_smbus_xfer()
2047 mlxbf_i2c_smbus_quick_command(&request, read); in mlxbf_i2c_smbus_xfer()
2052 mlxbf_i2c_smbus_byte_func(&request, in mlxbf_i2c_smbus_xfer()
2060 mlxbf_i2c_smbus_data_byte_func(&request, &command, &data->byte, in mlxbf_i2c_smbus_xfer()
2067 mlxbf_i2c_smbus_data_word_func(&request, &command, in mlxbf_i2c_smbus_xfer()
2075 mlxbf_i2c_smbus_i2c_block_func(&request, &command, data->block, in mlxbf_i2c_smbus_xfer()
2083 mlxbf_i2c_smbus_block_func(&request, &command, data->block, in mlxbf_i2c_smbus_xfer()
2090 mlxbf_i2c_smbus_process_call_func(&request, &command, in mlxbf_i2c_smbus_xfer()
2098 mlxbf_i2c_smbus_blk_process_call_func(&request, &command, in mlxbf_i2c_smbus_xfer()
2113 return mlxbf_i2c_smbus_start_transaction(priv, &request); in mlxbf_i2c_smbus_xfer()