Commit 8fa46d2a authored by Lucas Russo's avatar Lucas Russo

sm_io/chips/*: use new SMPR API for pluggable operations

Now, we pass the pointer to the operation
we want to use it, instead of the enum.
parent ad4d4456
......@@ -62,7 +62,7 @@ smch_24aa64_t * smch_24aa64_new (smio_t *parent, uint64_t base, uint32_t addr,
smch_24aa64_t *self = (smch_24aa64_t *) zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->i2c = smpr_new (SMCH_24AA64_NAME, parent, SMPR_I2C, verbose);
self->i2c = smpr_new (SMCH_24AA64_NAME, parent, &smpr_proto_ops_i2c, verbose);
ASSERT_ALLOC(self->i2c, err_i2c_alloc);
/* Initalize the I2C protocol */
......
......@@ -65,7 +65,7 @@ smch_ad9510_t * smch_ad9510_new (smio_t *parent, uint64_t base, uint32_t ss,
smch_ad9510_t *self = (smch_ad9510_t *) zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->spi = smpr_new (SMCH_AD9510_NAME, parent, SMPR_SPI, verbose);
self->spi = smpr_new (SMCH_AD9510_NAME, parent, &smpr_proto_ops_spi, verbose);
ASSERT_ALLOC(self->spi, err_spi_alloc);
/* Initalize the SPI protocol */
......@@ -735,7 +735,7 @@ static smch_err_e _smch_ad9510_init (smch_ad9510_t *self)
err_smpr_write, SMCH_ERR_RW_SMPR);
/* According to AD9510 datasheet Rev. B, page 46, table 25, regester 0x00 (CFG_SERIAL),
* does not need to be updated by setting the "update registers" bit. We still wait our default
* does not need to be updated by setting the "update registers" bit. We still wait our default
* ammount of time to be sure the chip is indeed reset */
SMCH_AD9510_WAIT_DFLT;
......@@ -746,7 +746,7 @@ static smch_err_e _smch_ad9510_init (smch_ad9510_t *self)
err_smpr_write, SMCH_ERR_RW_SMPR);
/* According to AD9510 datasheet Rev. B, page 46, table 25, regester 0x00 (CFG_SERIAL),
* does not need to be updated by setting the "update registers" bit. We still wait our default
* does not need to be updated by setting the "update registers" bit. We still wait our default
* ammount of time to be sure the chip is indeed reset */
/* Wait for reset to complete */
......
......@@ -58,7 +58,7 @@ smch_isla216p_t * smch_isla216p_new (smio_t *parent, uint64_t base, uint32_t ss,
smch_isla216p_t *self = (smch_isla216p_t *) zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->spi = smpr_new (SMCH_ISLA216P_NAME, parent, SMPR_SPI, verbose);
self->spi = smpr_new (SMCH_ISLA216P_NAME, parent, &smpr_proto_ops_spi, verbose);
ASSERT_ALLOC(self->spi, err_spi_alloc);
/* Initalize the SPI protocol */
......@@ -199,7 +199,7 @@ static smch_err_e _smch_isla216p_init (smch_isla216p_t *self)
err_smpr_write, SMCH_ERR_RW_SMPR);
#endif
data = ISLA216P_NAPSLP_W(ISLA216P_NAPSLP_NORMAL_OPERATION);
data = ISLA216P_NAPSLP_W(ISLA216P_NAPSLP_NORMAL_OPERATION);
rw_err = _smch_isla216p_write_8 (self, ISLA216P_REG_NAPSLP, &data);
ASSERT_TEST(rw_err == sizeof(uint8_t), "Could not write to ISLA216P_REG_NAPSLP",
err_smpr_write, SMCH_ERR_RW_SMPR);
......
......@@ -52,7 +52,7 @@ smch_pca9547_t * smch_pca9547_new (smio_t *parent, uint64_t base, uint32_t addr,
smch_pca9547_t *self = (smch_pca9547_t *) zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->i2c = smpr_new (SMCH_PCA9547_NAME, parent, SMPR_I2C, verbose);
self->i2c = smpr_new (SMCH_PCA9547_NAME, parent, &smpr_proto_ops_i2c, verbose);
ASSERT_ALLOC(self->i2c, err_i2c_alloc);
/* Initalize the I2C protocol */
......
......@@ -54,7 +54,7 @@ smch_rffe_t * smch_rffe_new (smio_t *parent, int verbose)
smch_rffe_t *self = (smch_rffe_t *) zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->bsmp = smpr_new (SMCH_RFFE_NAME, parent, SMPR_BSMP, verbose);
self->bsmp = smpr_new (SMCH_RFFE_NAME, parent, &smpr_proto_ops_bsmp, verbose);
ASSERT_ALLOC(self->bsmp, err_bsmp_alloc);
/* Initalize the BSMP protocol */
......
......@@ -85,7 +85,7 @@ smch_si57x_t * smch_si57x_new (smio_t *parent, uint64_t base, uint32_t addr,
smch_si57x_t *self = (smch_si57x_t *) zmalloc (sizeof *self);
ASSERT_ALLOC(self, err_self_alloc);
self->i2c = smpr_new (SMCH_SI57X_NAME, parent, SMPR_I2C, verbose);
self->i2c = smpr_new (SMCH_SI57X_NAME, parent, &smpr_proto_ops_i2c, verbose);
ASSERT_ALLOC(self->i2c, err_i2c_alloc);
/* Initalize the I2C protocol */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment