Lines Matching refs:sp
33 #define SCSPTR(sp) (sp->membase + 0x1c) argument
39 static inline void setbits(struct sh_sci_spi *sp, int bits, int on) in setbits() argument
50 sp->val |= bits; in setbits()
52 sp->val &= ~bits; in setbits()
54 iowrite8(sp->val, SCSPTR(sp)); in setbits()
69 struct sh_sci_spi *sp = spi_controller_get_devdata(dev->controller); in getmiso() local
71 return (ioread8(SCSPTR(sp)) & PIN_RXD) ? 1 : 0; in getmiso()
108 struct sh_sci_spi *sp = spi_controller_get_devdata(dev->controller); in sh_sci_spi_chipselect() local
110 if (sp->info->chip_select) in sh_sci_spi_chipselect()
111 (sp->info->chip_select)(sp->info, spi_get_chipselect(dev, 0), value); in sh_sci_spi_chipselect()
118 struct sh_sci_spi *sp; in sh_sci_spi_probe() local
128 sp = spi_controller_get_devdata(host); in sh_sci_spi_probe()
130 platform_set_drvdata(dev, sp); in sh_sci_spi_probe()
131 sp->info = dev_get_platdata(&dev->dev); in sh_sci_spi_probe()
132 if (!sp->info) { in sh_sci_spi_probe()
139 sp->bitbang.master = host; in sh_sci_spi_probe()
140 sp->bitbang.master->bus_num = sp->info->bus_num; in sh_sci_spi_probe()
141 sp->bitbang.master->num_chipselect = sp->info->num_chipselect; in sh_sci_spi_probe()
142 sp->bitbang.chipselect = sh_sci_spi_chipselect; in sh_sci_spi_probe()
144 sp->bitbang.txrx_word[SPI_MODE_0] = sh_sci_spi_txrx_mode0; in sh_sci_spi_probe()
145 sp->bitbang.txrx_word[SPI_MODE_1] = sh_sci_spi_txrx_mode1; in sh_sci_spi_probe()
146 sp->bitbang.txrx_word[SPI_MODE_2] = sh_sci_spi_txrx_mode2; in sh_sci_spi_probe()
147 sp->bitbang.txrx_word[SPI_MODE_3] = sh_sci_spi_txrx_mode3; in sh_sci_spi_probe()
154 sp->membase = ioremap(r->start, resource_size(r)); in sh_sci_spi_probe()
155 if (!sp->membase) { in sh_sci_spi_probe()
159 sp->val = ioread8(SCSPTR(sp)); in sh_sci_spi_probe()
160 setbits(sp, PIN_INIT, 1); in sh_sci_spi_probe()
162 ret = spi_bitbang_start(&sp->bitbang); in sh_sci_spi_probe()
166 setbits(sp, PIN_INIT, 0); in sh_sci_spi_probe()
167 iounmap(sp->membase); in sh_sci_spi_probe()
169 spi_controller_put(sp->bitbang.master); in sh_sci_spi_probe()
176 struct sh_sci_spi *sp = platform_get_drvdata(dev); in sh_sci_spi_remove() local
178 spi_bitbang_stop(&sp->bitbang); in sh_sci_spi_remove()
179 setbits(sp, PIN_INIT, 0); in sh_sci_spi_remove()
180 iounmap(sp->membase); in sh_sci_spi_remove()
181 spi_controller_put(sp->bitbang.master); in sh_sci_spi_remove()