mxic 35 drivers/mtd/nand/raw/nand_macronix.c struct nand_onfi_vendor_macronix *mxic; mxic 40 drivers/mtd/nand/raw/nand_macronix.c mxic = (struct nand_onfi_vendor_macronix *)p->onfi->vendor; mxic 41 drivers/mtd/nand/raw/nand_macronix.c if ((mxic->reliability_func & MACRONIX_READ_RETRY_BIT) == 0) mxic 177 drivers/spi/spi-mxic.c static int mxic_spi_clk_enable(struct mxic_spi *mxic) mxic 181 drivers/spi/spi-mxic.c ret = clk_prepare_enable(mxic->send_clk); mxic 185 drivers/spi/spi-mxic.c ret = clk_prepare_enable(mxic->send_dly_clk); mxic 192 drivers/spi/spi-mxic.c clk_disable_unprepare(mxic->send_clk); mxic 197 drivers/spi/spi-mxic.c static void mxic_spi_clk_disable(struct mxic_spi *mxic) mxic 199 drivers/spi/spi-mxic.c clk_disable_unprepare(mxic->send_clk); mxic 200 drivers/spi/spi-mxic.c clk_disable_unprepare(mxic->send_dly_clk); mxic 203 drivers/spi/spi-mxic.c static void mxic_spi_set_input_delay_dqs(struct mxic_spi *mxic, u8 idly_code) mxic 209 drivers/spi/spi-mxic.c mxic->regs + IDLY_CODE(0)); mxic 214 drivers/spi/spi-mxic.c mxic->regs + IDLY_CODE(1)); mxic 217 drivers/spi/spi-mxic.c static int mxic_spi_clk_setup(struct mxic_spi *mxic, unsigned long freq) mxic 221 drivers/spi/spi-mxic.c ret = clk_set_rate(mxic->send_clk, freq); mxic 225 drivers/spi/spi-mxic.c ret = clk_set_rate(mxic->send_dly_clk, freq); mxic 233 drivers/spi/spi-mxic.c mxic_spi_set_input_delay_dqs(mxic, 0xf); mxic 243 drivers/spi/spi-mxic.c ret = clk_set_phase(mxic->send_dly_clk, 9 * freq / 25000000); mxic 250 drivers/spi/spi-mxic.c static int mxic_spi_set_freq(struct mxic_spi *mxic, unsigned long freq) mxic 254 drivers/spi/spi-mxic.c if (mxic->cur_speed_hz == freq) mxic 257 drivers/spi/spi-mxic.c mxic_spi_clk_disable(mxic); mxic 258 drivers/spi/spi-mxic.c ret = mxic_spi_clk_setup(mxic, freq); mxic 262 drivers/spi/spi-mxic.c ret = mxic_spi_clk_enable(mxic); mxic 266 drivers/spi/spi-mxic.c mxic->cur_speed_hz = freq; mxic 271 drivers/spi/spi-mxic.c static void mxic_spi_hw_init(struct mxic_spi *mxic) mxic 273 drivers/spi/spi-mxic.c writel(0, mxic->regs + DATA_STROB); mxic 274 drivers/spi/spi-mxic.c writel(INT_STS_ALL, mxic->regs + INT_STS_EN); mxic 275 drivers/spi/spi-mxic.c writel(0, mxic->regs + HC_EN); mxic 276 drivers/spi/spi-mxic.c writel(0, mxic->regs + LRD_CFG); mxic 277 drivers/spi/spi-mxic.c writel(0, mxic->regs + LRD_CTRL); mxic 280 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 283 drivers/spi/spi-mxic.c static int mxic_spi_data_xfer(struct mxic_spi *mxic, const void *txbuf, mxic 300 drivers/spi/spi-mxic.c ret = readl_poll_timeout(mxic->regs + INT_STS, sts, mxic 305 drivers/spi/spi-mxic.c writel(data, mxic->regs + TXD(nbytes % 4)); mxic 308 drivers/spi/spi-mxic.c ret = readl_poll_timeout(mxic->regs + INT_STS, sts, mxic 314 drivers/spi/spi-mxic.c ret = readl_poll_timeout(mxic->regs + INT_STS, sts, mxic 320 drivers/spi/spi-mxic.c data = readl(mxic->regs + RXD); mxic 323 drivers/spi/spi-mxic.c WARN_ON(readl(mxic->regs + INT_STS) & INT_RX_NOT_EMPTY); mxic 325 drivers/spi/spi-mxic.c readl(mxic->regs + RXD); mxic 327 drivers/spi/spi-mxic.c WARN_ON(readl(mxic->regs + INT_STS) & INT_RX_NOT_EMPTY); mxic 355 drivers/spi/spi-mxic.c struct mxic_spi *mxic = spi_master_get_devdata(mem->spi->master); mxic 360 drivers/spi/spi-mxic.c ret = mxic_spi_set_freq(mxic, mem->spi->max_speed_hz); mxic 373 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 374 drivers/spi/spi-mxic.c writel(HC_EN_BIT, mxic->regs + HC_EN); mxic 391 drivers/spi/spi-mxic.c writel(ss_ctrl, mxic->regs + SS_CTRL(mem->spi->chip_select)); mxic 393 drivers/spi/spi-mxic.c writel(readl(mxic->regs + HC_CFG) | HC_CFG_MAN_CS_ASSERT, mxic 394 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 396 drivers/spi/spi-mxic.c ret = mxic_spi_data_xfer(mxic, &op->cmd.opcode, NULL, 1); mxic 403 drivers/spi/spi-mxic.c ret = mxic_spi_data_xfer(mxic, addr, NULL, op->addr.nbytes); mxic 407 drivers/spi/spi-mxic.c ret = mxic_spi_data_xfer(mxic, NULL, NULL, op->dummy.nbytes); mxic 411 drivers/spi/spi-mxic.c ret = mxic_spi_data_xfer(mxic, mxic 419 drivers/spi/spi-mxic.c writel(readl(mxic->regs + HC_CFG) & ~HC_CFG_MAN_CS_ASSERT, mxic 420 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 421 drivers/spi/spi-mxic.c writel(0, mxic->regs + HC_EN); mxic 433 drivers/spi/spi-mxic.c struct mxic_spi *mxic = spi_master_get_devdata(spi->master); mxic 436 drivers/spi/spi-mxic.c writel(readl(mxic->regs + HC_CFG) | HC_CFG_MAN_CS_EN, mxic 437 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 438 drivers/spi/spi-mxic.c writel(HC_EN_BIT, mxic->regs + HC_EN); mxic 439 drivers/spi/spi-mxic.c writel(readl(mxic->regs + HC_CFG) | HC_CFG_MAN_CS_ASSERT, mxic 440 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 442 drivers/spi/spi-mxic.c writel(readl(mxic->regs + HC_CFG) & ~HC_CFG_MAN_CS_ASSERT, mxic 443 drivers/spi/spi-mxic.c mxic->regs + HC_CFG); mxic 444 drivers/spi/spi-mxic.c writel(0, mxic->regs + HC_EN); mxic 452 drivers/spi/spi-mxic.c struct mxic_spi *mxic = spi_master_get_devdata(master); mxic 464 drivers/spi/spi-mxic.c ret = mxic_spi_set_freq(mxic, t->speed_hz); mxic 482 drivers/spi/spi-mxic.c mxic->regs + SS_CTRL(0)); mxic 484 drivers/spi/spi-mxic.c ret = mxic_spi_data_xfer(mxic, t->tx_buf, t->rx_buf, t->len); mxic 496 drivers/spi/spi-mxic.c struct mxic_spi *mxic = spi_master_get_devdata(master); mxic 498 drivers/spi/spi-mxic.c mxic_spi_clk_disable(mxic); mxic 499 drivers/spi/spi-mxic.c clk_disable_unprepare(mxic->ps_clk); mxic 507 drivers/spi/spi-mxic.c struct mxic_spi *mxic = spi_master_get_devdata(master); mxic 510 drivers/spi/spi-mxic.c ret = clk_prepare_enable(mxic->ps_clk); mxic 516 drivers/spi/spi-mxic.c return mxic_spi_clk_enable(mxic); mxic 528 drivers/spi/spi-mxic.c struct mxic_spi *mxic; mxic 537 drivers/spi/spi-mxic.c mxic = spi_master_get_devdata(master); mxic 541 drivers/spi/spi-mxic.c mxic->ps_clk = devm_clk_get(&pdev->dev, "ps_clk"); mxic 542 drivers/spi/spi-mxic.c if (IS_ERR(mxic->ps_clk)) mxic 543 drivers/spi/spi-mxic.c return PTR_ERR(mxic->ps_clk); mxic 545 drivers/spi/spi-mxic.c mxic->send_clk = devm_clk_get(&pdev->dev, "send_clk"); mxic 546 drivers/spi/spi-mxic.c if (IS_ERR(mxic->send_clk)) mxic 547 drivers/spi/spi-mxic.c return PTR_ERR(mxic->send_clk); mxic 549 drivers/spi/spi-mxic.c mxic->send_dly_clk = devm_clk_get(&pdev->dev, "send_dly_clk"); mxic 550 drivers/spi/spi-mxic.c if (IS_ERR(mxic->send_dly_clk)) mxic 551 drivers/spi/spi-mxic.c return PTR_ERR(mxic->send_dly_clk); mxic 554 drivers/spi/spi-mxic.c mxic->regs = devm_ioremap_resource(&pdev->dev, res); mxic 555 drivers/spi/spi-mxic.c if (IS_ERR(mxic->regs)) mxic 556 drivers/spi/spi-mxic.c return PTR_ERR(mxic->regs); mxic 571 drivers/spi/spi-mxic.c mxic_spi_hw_init(mxic);