Lines Matching refs:spifc

80 static void meson_spifc_drain_buffer(struct meson_spifc_priv *spifc,  in meson_spifc_drain_buffer()  argument
87 regmap_read(spifc->regmap, REG_C0 + i, &data); in meson_spifc_drain_buffer()
106 static void meson_spifc_fill_buffer(struct meson_spifc_priv *spifc, in meson_spifc_fill_buffer() argument
118 regmap_write(spifc->regmap, REG_C0 + i, data); in meson_spifc_fill_buffer()
136 static int meson_spifc_txrx(struct meson_spifc_priv *spifc, in meson_spifc_txrx() argument
145 meson_spifc_fill_buffer(spifc, dout + offset, len); in meson_spifc_txrx()
148 regmap_update_bits(spifc->regmap, REG_USER, USER_UC_MASK, in meson_spifc_txrx()
150 regmap_write(spifc->regmap, REG_USER1, in meson_spifc_txrx()
154 regmap_update_bits(spifc->regmap, REG_USER, USER_DIN_EN_MS, in meson_spifc_txrx()
160 regmap_update_bits(spifc->regmap, REG_USER4, USER4_CS_ACT, in meson_spifc_txrx()
164 regmap_update_bits(spifc->regmap, REG_SLAVE, SLAVE_TRST_DONE, 0); in meson_spifc_txrx()
166 regmap_update_bits(spifc->regmap, REG_CMD, CMD_USER, CMD_USER); in meson_spifc_txrx()
169 ret = regmap_read_poll_timeout(spifc->regmap, REG_SLAVE, data, in meson_spifc_txrx()
174 meson_spifc_drain_buffer(spifc, din + offset, len); in meson_spifc_txrx()
191 struct meson_spifc_priv *spifc = dev_get_priv(slave->parent); in meson_spifc_xfer() local
200 regmap_update_bits(spifc->regmap, REG_CTRL, CTRL_ENABLE_AHB, 0); in meson_spifc_xfer()
204 ret = meson_spifc_txrx(spifc, dout, din, done, len, in meson_spifc_xfer()
210 regmap_update_bits(spifc->regmap, REG_CTRL, CTRL_ENABLE_AHB, in meson_spifc_xfer()
223 struct meson_spifc_priv *spifc = dev_get_priv(dev); in meson_spifc_set_speed() local
227 parent = clk_get_rate(&spifc->clk); in meson_spifc_set_speed()
237 regmap_write(spifc->regmap, REG_CLOCK, value); in meson_spifc_set_speed()
250 struct meson_spifc_priv *spifc = dev_get_priv(dev); in meson_spifc_set_mode() local
256 regmap_update_bits(spifc->regmap, REG_USER, USER_CLK_NOT_INV, in meson_spifc_set_mode()
259 regmap_update_bits(spifc->regmap, REG_USER4, USER4_CS_POL_HIGH, in meson_spifc_set_mode()
269 static void meson_spifc_hw_init(struct meson_spifc_priv *spifc) in meson_spifc_hw_init() argument
272 regmap_update_bits(spifc->regmap, REG_SLAVE, SLAVE_SW_RST, in meson_spifc_hw_init()
275 regmap_update_bits(spifc->regmap, REG_USER, USER_CMP_MODE, 0); in meson_spifc_hw_init()
277 regmap_update_bits(spifc->regmap, REG_SLAVE, SLAVE_OP_MODE, 0); in meson_spifc_hw_init()