spifc 94 drivers/spi/spi-meson-spifc.c static int meson_spifc_wait_ready(struct meson_spifc *spifc) spifc 100 drivers/spi/spi-meson-spifc.c regmap_read(spifc->regmap, REG_SLAVE, &data); spifc 115 drivers/spi/spi-meson-spifc.c static void meson_spifc_drain_buffer(struct meson_spifc *spifc, u8 *buf, spifc 122 drivers/spi/spi-meson-spifc.c regmap_read(spifc->regmap, REG_C0 + i, &data); spifc 141 drivers/spi/spi-meson-spifc.c static void meson_spifc_fill_buffer(struct meson_spifc *spifc, const u8 *buf, spifc 153 drivers/spi/spi-meson-spifc.c regmap_write(spifc->regmap, REG_C0 + i, data); spifc 165 drivers/spi/spi-meson-spifc.c static void meson_spifc_setup_speed(struct meson_spifc *spifc, u32 speed) spifc 170 drivers/spi/spi-meson-spifc.c parent = clk_get_rate(spifc->clk); spifc 173 drivers/spi/spi-meson-spifc.c dev_dbg(spifc->dev, "parent %lu, speed %u, n %d\n", parent, spifc 181 drivers/spi/spi-meson-spifc.c regmap_write(spifc->regmap, REG_CLOCK, value); spifc 194 drivers/spi/spi-meson-spifc.c static int meson_spifc_txrx(struct meson_spifc *spifc, spifc 203 drivers/spi/spi-meson-spifc.c meson_spifc_fill_buffer(spifc, xfer->tx_buf + offset, len); spifc 206 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_USER, USER_UC_MASK, spifc 208 drivers/spi/spi-meson-spifc.c regmap_write(spifc->regmap, REG_USER1, spifc 212 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_USER, USER_DIN_EN_MS, spifc 222 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_USER4, USER4_CS_ACT, spifc 226 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_SLAVE, SLAVE_TRST_DONE, 0); spifc 228 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_CMD, CMD_USER, CMD_USER); spifc 230 drivers/spi/spi-meson-spifc.c ret = meson_spifc_wait_ready(spifc); spifc 233 drivers/spi/spi-meson-spifc.c meson_spifc_drain_buffer(spifc, xfer->rx_buf + offset, len); spifc 249 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc = spi_master_get_devdata(master); spifc 252 drivers/spi/spi-meson-spifc.c meson_spifc_setup_speed(spifc, xfer->speed_hz); spifc 254 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_CTRL, CTRL_ENABLE_AHB, 0); spifc 258 drivers/spi/spi-meson-spifc.c ret = meson_spifc_txrx(spifc, xfer, done, len, spifc 264 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_CTRL, CTRL_ENABLE_AHB, spifc 274 drivers/spi/spi-meson-spifc.c static void meson_spifc_hw_init(struct meson_spifc *spifc) spifc 277 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_SLAVE, SLAVE_SW_RST, spifc 280 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_USER, USER_CMP_MODE, 0); spifc 282 drivers/spi/spi-meson-spifc.c regmap_update_bits(spifc->regmap, REG_SLAVE, SLAVE_OP_MODE, 0); spifc 288 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc; spifc 299 drivers/spi/spi-meson-spifc.c spifc = spi_master_get_devdata(master); spifc 300 drivers/spi/spi-meson-spifc.c spifc->dev = &pdev->dev; spifc 308 drivers/spi/spi-meson-spifc.c spifc->regmap = devm_regmap_init_mmio(spifc->dev, base, spifc 310 drivers/spi/spi-meson-spifc.c if (IS_ERR(spifc->regmap)) { spifc 311 drivers/spi/spi-meson-spifc.c ret = PTR_ERR(spifc->regmap); spifc 315 drivers/spi/spi-meson-spifc.c spifc->clk = devm_clk_get(spifc->dev, NULL); spifc 316 drivers/spi/spi-meson-spifc.c if (IS_ERR(spifc->clk)) { spifc 317 drivers/spi/spi-meson-spifc.c dev_err(spifc->dev, "missing clock\n"); spifc 318 drivers/spi/spi-meson-spifc.c ret = PTR_ERR(spifc->clk); spifc 322 drivers/spi/spi-meson-spifc.c ret = clk_prepare_enable(spifc->clk); spifc 324 drivers/spi/spi-meson-spifc.c dev_err(spifc->dev, "can't prepare clock\n"); spifc 328 drivers/spi/spi-meson-spifc.c rate = clk_get_rate(spifc->clk); spifc 338 drivers/spi/spi-meson-spifc.c meson_spifc_hw_init(spifc); spifc 340 drivers/spi/spi-meson-spifc.c pm_runtime_set_active(spifc->dev); spifc 341 drivers/spi/spi-meson-spifc.c pm_runtime_enable(spifc->dev); spifc 343 drivers/spi/spi-meson-spifc.c ret = devm_spi_register_master(spifc->dev, master); spifc 345 drivers/spi/spi-meson-spifc.c dev_err(spifc->dev, "failed to register spi master\n"); spifc 351 drivers/spi/spi-meson-spifc.c clk_disable_unprepare(spifc->clk); spifc 360 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc = spi_master_get_devdata(master); spifc 363 drivers/spi/spi-meson-spifc.c clk_disable_unprepare(spifc->clk); spifc 373 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc = spi_master_get_devdata(master); spifc 381 drivers/spi/spi-meson-spifc.c clk_disable_unprepare(spifc->clk); spifc 389 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc = spi_master_get_devdata(master); spifc 393 drivers/spi/spi-meson-spifc.c ret = clk_prepare_enable(spifc->clk); spifc 398 drivers/spi/spi-meson-spifc.c meson_spifc_hw_init(spifc); spifc 402 drivers/spi/spi-meson-spifc.c clk_disable_unprepare(spifc->clk); spifc 412 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc = spi_master_get_devdata(master); spifc 414 drivers/spi/spi-meson-spifc.c clk_disable_unprepare(spifc->clk); spifc 422 drivers/spi/spi-meson-spifc.c struct meson_spifc *spifc = spi_master_get_devdata(master); spifc 424 drivers/spi/spi-meson-spifc.c return clk_prepare_enable(spifc->clk);