Lines Matching defs:request
735 struct mlxbf_i2c_smbus_request *request)
745 if (request->operation_cnt > MLXBF_I2C_SMBUS_MAX_OP_CNT)
756 slave = request->slave & GENMASK(6, 0);
775 for (op_idx = 0; op_idx < request->operation_cnt; op_idx++) {
776 operation = &request->operation[op_idx];
866 mlxbf_i2c_smbus_quick_command(struct mlxbf_i2c_smbus_request *request,
869 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_1;
871 request->operation[0].length = 0;
872 request->operation[0].flags = MLXBF_I2C_F_WRITE;
873 request->operation[0].flags |= read ? MLXBF_I2C_F_READ : 0;
876 static void mlxbf_i2c_smbus_byte_func(struct mlxbf_i2c_smbus_request *request,
879 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_1;
881 request->operation[0].length = 1;
882 request->operation[0].length += pec_check;
884 request->operation[0].flags = MLXBF_I2C_F_SMBUS_OPERATION;
885 request->operation[0].flags |= read ?
887 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0;
889 request->operation[0].buffer = data;
893 mlxbf_i2c_smbus_data_byte_func(struct mlxbf_i2c_smbus_request *request,
896 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2;
898 request->operation[0].length = 1;
899 request->operation[0].flags =
901 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0;
902 request->operation[0].buffer = command;
904 request->operation[1].length = 1;
905 request->operation[1].length += pec_check;
906 request->operation[1].flags = read ?
908 request->operation[1].buffer = data;
912 mlxbf_i2c_smbus_data_word_func(struct mlxbf_i2c_smbus_request *request,
915 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2;
917 request->operation[0].length = 1;
918 request->operation[0].flags =
920 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0;
921 request->operation[0].buffer = command;
923 request->operation[1].length = 2;
924 request->operation[1].length += pec_check;
925 request->operation[1].flags = read ?
927 request->operation[1].buffer = data;
931 mlxbf_i2c_smbus_i2c_block_func(struct mlxbf_i2c_smbus_request *request,
935 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2;
937 request->operation[0].length = 1;
938 request->operation[0].flags =
940 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0;
941 request->operation[0].buffer = command;
948 request->operation[1].length =
951 request->operation[1].flags = read ?
957 request->operation[1].buffer = data + 1;
959 *data_len = request->operation[1].length;
966 static void mlxbf_i2c_smbus_block_func(struct mlxbf_i2c_smbus_request *request,
970 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_2;
972 request->operation[0].length = 1;
973 request->operation[0].flags =
975 request->operation[0].flags |= MLXBF_I2C_F_SMBUS_BLOCK;
976 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0;
977 request->operation[0].buffer = command;
979 request->operation[1].length =
982 request->operation[1].flags = read ?
984 request->operation[1].buffer = data + 1;
986 *data_len = request->operation[1].length;
994 mlxbf_i2c_smbus_process_call_func(struct mlxbf_i2c_smbus_request *request,
997 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_3;
999 request->operation[0].length = 1;
1000 request->operation[0].flags =
1002 request->operation[0].flags |= MLXBF_I2C_F_SMBUS_BLOCK;
1003 request->operation[0].flags |= pec_check ? MLXBF_I2C_F_SMBUS_PEC : 0;
1004 request->operation[0].buffer = command;
1006 request->operation[1].length = 2;
1007 request->operation[1].flags = MLXBF_I2C_F_WRITE;
1008 request->operation[1].buffer = data;
1010 request->operation[2].length = 3;
1011 request->operation[2].flags = MLXBF_I2C_F_READ;
1012 request->operation[2].buffer = data;
1016 mlxbf_i2c_smbus_blk_process_call_func(struct mlxbf_i2c_smbus_request *request,
1022 request->operation_cnt = MLXBF_I2C_SMBUS_OP_CNT_3;
1024 request->operation[0].length = 1;
1025 request->operation[0].flags =
1027 request->operation[0].flags |= MLXBF_I2C_F_SMBUS_BLOCK;
1028 request->operation[0].flags |= (pec_check) ? MLXBF_I2C_F_SMBUS_PEC : 0;
1029 request->operation[0].buffer = command;
1034 request->operation[1].length = length - pec_check;
1035 request->operation[1].flags = MLXBF_I2C_F_WRITE;
1036 request->operation[1].buffer = data;
1038 request->operation[2].length = length;
1039 request->operation[2].flags = MLXBF_I2C_F_READ;
1040 request->operation[2].buffer = data;
2074 struct mlxbf_i2c_smbus_request request = { 0 };
2079 request.slave = addr;
2086 mlxbf_i2c_smbus_quick_command(&request, read);
2091 mlxbf_i2c_smbus_byte_func(&request,
2099 mlxbf_i2c_smbus_data_byte_func(&request, &command, &data->byte,
2106 mlxbf_i2c_smbus_data_word_func(&request, &command,
2114 mlxbf_i2c_smbus_i2c_block_func(&request, &command, data->block,
2122 mlxbf_i2c_smbus_block_func(&request, &command, data->block,
2129 mlxbf_i2c_smbus_process_call_func(&request, &command,
2137 mlxbf_i2c_smbus_blk_process_call_func(&request, &command,
2152 return mlxbf_i2c_smbus_start_transaction(priv, &request);