Lines Matching refs:plat
33 struct sandbox_i2c_pmic_plat_data *plat = dev_get_plat(emul); in sandbox_i2c_pmic_read_data() local
35 if (plat->rw_idx + len > plat->buf_size) { in sandbox_i2c_pmic_read_data()
37 plat->reg_count); in sandbox_i2c_pmic_read_data()
42 (unsigned int)chip & 0xff, plat->rw_reg, plat->rw_idx, len); in sandbox_i2c_pmic_read_data()
44 memcpy(buffer, plat->reg + plat->rw_idx, len); in sandbox_i2c_pmic_read_data()
53 struct sandbox_i2c_pmic_plat_data *plat = dev_get_plat(emul); in sandbox_i2c_pmic_write_data() local
60 plat->rw_reg = *buffer; in sandbox_i2c_pmic_write_data()
61 plat->rw_idx = plat->rw_reg * plat->trans_len; in sandbox_i2c_pmic_write_data()
64 (unsigned int)chip & 0xff, plat->rw_reg, plat->rw_idx, len); in sandbox_i2c_pmic_write_data()
73 if (plat->rw_idx + len > plat->buf_size) { in sandbox_i2c_pmic_write_data()
75 plat->reg_count); in sandbox_i2c_pmic_write_data()
78 memcpy(plat->reg + plat->rw_idx, buffer, len); in sandbox_i2c_pmic_write_data()
108 struct sandbox_i2c_pmic_plat_data *plat = dev_get_plat(emul); in sandbox_i2c_pmic_of_to_plat() local
112 plat->reg_count = pmic_reg_count(pmic_dev); in sandbox_i2c_pmic_of_to_plat()
119 struct sandbox_i2c_pmic_plat_data *plat = dev_get_plat(emul); in sandbox_i2c_pmic_probe() local
124 plat->trans_len = upriv->trans_len; in sandbox_i2c_pmic_probe()
125 plat->buf_size = plat->reg_count * plat->trans_len; in sandbox_i2c_pmic_probe()
127 plat->reg = calloc(1, plat->buf_size); in sandbox_i2c_pmic_probe()
128 if (!plat->reg) { in sandbox_i2c_pmic_probe()
130 plat->buf_size); in sandbox_i2c_pmic_probe()
135 plat->buf_size); in sandbox_i2c_pmic_probe()
140 free(plat->reg); in sandbox_i2c_pmic_probe()
144 memcpy(plat->reg, reg_defaults, plat->buf_size); in sandbox_i2c_pmic_probe()