Lines Matching refs:spi100k
93 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in spi100k_enable_clock() local
96 val = readw(spi100k->base + SPI_SETUP1); in spi100k_enable_clock()
98 writew(val, spi100k->base + SPI_SETUP1); in spi100k_enable_clock()
104 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in spi100k_disable_clock() local
107 val = readw(spi100k->base + SPI_SETUP1); in spi100k_disable_clock()
109 writew(val, spi100k->base + SPI_SETUP1); in spi100k_disable_clock()
114 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in spi100k_write_data() local
123 writew(data , spi100k->base + SPI_TX_MSB); in spi100k_write_data()
128 spi100k->base + SPI_CTRL); in spi100k_write_data()
131 while ((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_WE) != SPI_STATUS_WE) in spi100k_write_data()
141 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in spi100k_read_data() local
151 spi100k->base + SPI_CTRL); in spi100k_read_data()
153 while ((readw(spi100k->base + SPI_STATUS) & SPI_STATUS_RD) != SPI_STATUS_RD) in spi100k_read_data()
157 dataL = readw(spi100k->base + SPI_RX_LSB); in spi100k_read_data()
158 dataH = readw(spi100k->base + SPI_RX_MSB); in spi100k_read_data()
167 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in spi100k_open() local
171 SPI_SETUP1_CLOCK_DIVISOR(0), spi100k->base + SPI_SETUP1); in spi100k_open()
176 SPI_SETUP2_LEVEL_TRIGGER, spi100k->base + SPI_SETUP2); in spi100k_open()
179 static void omap1_spi100k_force_cs(struct omap1_spi100k *spi100k, int enable) in omap1_spi100k_force_cs() argument
182 writew(0x05fc, spi100k->base + SPI_CTRL); in omap1_spi100k_force_cs()
184 writew(0x05fd, spi100k->base + SPI_CTRL); in omap1_spi100k_force_cs()
245 struct omap1_spi100k *spi100k = spi_master_get_devdata(spi->master); in omap1_spi100k_setup_transfer() local
259 writew(0x3e , spi100k->base + SPI_SETUP1); in omap1_spi100k_setup_transfer()
260 writew(0x00 , spi100k->base + SPI_STATUS); in omap1_spi100k_setup_transfer()
261 writew(0x3e , spi100k->base + SPI_CTRL); in omap1_spi100k_setup_transfer()
272 struct omap1_spi100k *spi100k; in omap1_spi100k_setup() local
275 spi100k = spi_master_get_devdata(spi->master); in omap1_spi100k_setup()
281 cs->base = spi100k->base + spi->chip_select * 0x14; in omap1_spi100k_setup()
287 clk_prepare_enable(spi100k->ick); in omap1_spi100k_setup()
288 clk_prepare_enable(spi100k->fck); in omap1_spi100k_setup()
292 clk_disable_unprepare(spi100k->ick); in omap1_spi100k_setup()
293 clk_disable_unprepare(spi100k->fck); in omap1_spi100k_setup()
301 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in omap1_spi100k_transfer_one_message() local
317 omap1_spi100k_force_cs(spi100k, 1); in omap1_spi100k_transfer_one_message()
339 omap1_spi100k_force_cs(spi100k, 0); in omap1_spi100k_transfer_one_message()
347 omap1_spi100k_force_cs(spi100k, 0); in omap1_spi100k_transfer_one_message()
359 struct omap1_spi100k *spi100k; in omap1_spi100k_probe() local
365 master = spi_alloc_master(&pdev->dev, sizeof(*spi100k)); in omap1_spi100k_probe()
383 spi100k = spi_master_get_devdata(master); in omap1_spi100k_probe()
390 spi100k->base = (void __iomem *)dev_get_platdata(&pdev->dev); in omap1_spi100k_probe()
392 spi100k->ick = devm_clk_get(&pdev->dev, "ick"); in omap1_spi100k_probe()
393 if (IS_ERR(spi100k->ick)) { in omap1_spi100k_probe()
395 status = PTR_ERR(spi100k->ick); in omap1_spi100k_probe()
399 spi100k->fck = devm_clk_get(&pdev->dev, "fck"); in omap1_spi100k_probe()
400 if (IS_ERR(spi100k->fck)) { in omap1_spi100k_probe()
402 status = PTR_ERR(spi100k->fck); in omap1_spi100k_probe()
406 status = clk_prepare_enable(spi100k->ick); in omap1_spi100k_probe()
412 status = clk_prepare_enable(spi100k->fck); in omap1_spi100k_probe()
428 clk_disable_unprepare(spi100k->fck); in omap1_spi100k_probe()
430 clk_disable_unprepare(spi100k->ick); in omap1_spi100k_probe()
439 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in omap1_spi100k_remove() local
443 clk_disable_unprepare(spi100k->fck); in omap1_spi100k_remove()
444 clk_disable_unprepare(spi100k->ick); in omap1_spi100k_remove()
453 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in omap1_spi100k_runtime_suspend() local
455 clk_disable_unprepare(spi100k->ick); in omap1_spi100k_runtime_suspend()
456 clk_disable_unprepare(spi100k->fck); in omap1_spi100k_runtime_suspend()
464 struct omap1_spi100k *spi100k = spi_master_get_devdata(master); in omap1_spi100k_runtime_resume() local
467 ret = clk_prepare_enable(spi100k->ick); in omap1_spi100k_runtime_resume()
473 ret = clk_prepare_enable(spi100k->fck); in omap1_spi100k_runtime_resume()
476 clk_disable_unprepare(spi100k->ick); in omap1_spi100k_runtime_resume()