Lines Matching full:pp
96 static inline void deassertCS(struct spi_lm70llp *pp) in deassertCS() argument
98 u8 data = parport_read_data(pp->port); in deassertCS()
101 parport_write_data(pp->port, data | nCS); in deassertCS()
104 static inline void assertCS(struct spi_lm70llp *pp) in assertCS() argument
106 u8 data = parport_read_data(pp->port); in assertCS()
109 parport_write_data(pp->port, data & ~nCS); in assertCS()
112 static inline void clkHigh(struct spi_lm70llp *pp) in clkHigh() argument
114 u8 data = parport_read_data(pp->port); in clkHigh()
116 parport_write_data(pp->port, data | SCLK); in clkHigh()
119 static inline void clkLow(struct spi_lm70llp *pp) in clkLow() argument
121 u8 data = parport_read_data(pp->port); in clkLow()
123 parport_write_data(pp->port, data & ~SCLK); in clkLow()
135 struct spi_lm70llp *pp = spidev_to_pp(s); in setsck() local
138 clkHigh(pp); in setsck()
140 clkLow(pp); in setsck()
160 struct spi_lm70llp *pp = spidev_to_pp(s); in getmiso() local
162 return ((SIO == (parport_read_status(pp->port) & SIO)) ? 0 : 1); in getmiso()
171 struct spi_lm70llp *pp = spidev_to_pp(spi); in lm70_chipselect() local
174 assertCS(pp); in lm70_chipselect()
176 deassertCS(pp); in lm70_chipselect()
191 struct spi_lm70llp *pp; in spi_lm70llp_attach() local
205 host = spi_alloc_host(p->physport->dev, sizeof(*pp)); in spi_lm70llp_attach()
210 pp = spi_controller_get_devdata(host); in spi_lm70llp_attach()
215 pp->bitbang.ctlr = host; in spi_lm70llp_attach()
216 pp->bitbang.chipselect = lm70_chipselect; in spi_lm70llp_attach()
217 pp->bitbang.txrx_word[SPI_MODE_0] = lm70_txrx; in spi_lm70llp_attach()
218 pp->bitbang.flags = SPI_3WIRE; in spi_lm70llp_attach()
223 pp->port = p; in spi_lm70llp_attach()
225 lm70llp_cb.private = pp; in spi_lm70llp_attach()
233 pp->pd = pd; in spi_lm70llp_attach()
242 status = spi_bitbang_start(&pp->bitbang); in spi_lm70llp_attach()
255 strcpy(pp->info.modalias, "lm70"); in spi_lm70llp_attach()
256 pp->info.max_speed_hz = 6 * 1000 * 1000; in spi_lm70llp_attach()
257 pp->info.chip_select = 0; in spi_lm70llp_attach()
258 pp->info.mode = SPI_3WIRE | SPI_MODE_0; in spi_lm70llp_attach()
261 parport_write_data(pp->port, lm70_INIT); in spi_lm70llp_attach()
266 pp->info.controller_data = pp; in spi_lm70llp_attach()
267 pp->spidev_lm70 = spi_new_device(pp->bitbang.ctlr, &pp->info); in spi_lm70llp_attach()
268 if (pp->spidev_lm70) in spi_lm70llp_attach()
269 dev_dbg(&pp->spidev_lm70->dev, "spidev_lm70 at %s\n", in spi_lm70llp_attach()
270 dev_name(&pp->spidev_lm70->dev)); in spi_lm70llp_attach()
276 pp->spidev_lm70->bits_per_word = 8; in spi_lm70llp_attach()
278 lm70llp = pp; in spi_lm70llp_attach()
282 spi_bitbang_stop(&pp->bitbang); in spi_lm70llp_attach()
285 parport_write_data(pp->port, 0); in spi_lm70llp_attach()
287 parport_release(pp->pd); in spi_lm70llp_attach()
298 struct spi_lm70llp *pp; in spi_lm70llp_detach() local
303 pp = lm70llp; in spi_lm70llp_detach()
304 spi_bitbang_stop(&pp->bitbang); in spi_lm70llp_detach()
307 parport_write_data(pp->port, 0); in spi_lm70llp_detach()
309 parport_release(pp->pd); in spi_lm70llp_detach()
310 parport_unregister_device(pp->pd); in spi_lm70llp_detach()
312 spi_controller_put(pp->bitbang.ctlr); in spi_lm70llp_detach()