• Home
  • Raw
  • Download

Lines Matching +full:llp +full:- +full:based

2  * Driver for LM70EVAL-LLP board for the LM70 sensor
32 * The LM70 communicates with a host processor using a 3-wire variant of
34 * NS LM70 LLP Evaluation Board, interfacing to a PC using its parallel
35 * port to bitbang an SPI-parport bridge. Accordingly, this is an SPI
42 * The schematic for this particular board (the LM70EVAL-LLP) is
46 * Also see Documentation/spi/spi-lm70llp. The SPI<->parport code here is
47 * (heavily) based on spi-butterfly by David Brownell.
49 * The LM70 LLP connects to the PC parallel port in the following manner:
51 * Parallel LM70 LLP
53 * ----------- --------- ------------
54 * D0 2 - -
55 * D1 3 --> V+ 5
56 * D2 4 --> V+ 5
57 * D3 5 --> V+ 5
58 * D4 6 --> V+ 5
59 * D5 7 --> nCS 8
60 * D6 8 --> SCLK 3
61 * D7 9 --> SI/O 5
62 * GND 25 - GND 7
63 * Select 13 <-- SI/O 1
70 #define DRVNAME "spi-lm70llp"
77 /*-------------------------------------------------------------------------*/
91 /*-------------------------------------------------------------------*/
95 return spi->controller_data; in spidev_to_pp()
98 /*---------------------- LM70 LLP eval board-specific inlines follow */
107 u8 data = parport_read_data(pp->port); in deassertCS()
109 data &= ~0x80; /* pull D7/SI-out low while de-asserted */ in deassertCS()
110 parport_write_data(pp->port, data | nCS); in deassertCS()
115 u8 data = parport_read_data(pp->port); in assertCS()
117 data |= 0x80; /* pull D7/SI-out high so lm70 drives SO-in */ in assertCS()
118 parport_write_data(pp->port, data & ~nCS); in assertCS()
123 u8 data = parport_read_data(pp->port); in clkHigh()
125 parport_write_data(pp->port, data | SCLK); in clkHigh()
130 u8 data = parport_read_data(pp->port); in clkLow()
132 parport_write_data(pp->port, data & ~SCLK); in clkLow()
135 /*------------------------- SPI-LM70-specific inlines ----------------------*/
162 * Why do we return 0 when the SIO line is high and vice-versa?
165 * switches it to low reflecting this on the parport (pin 13), and vice-versa.
171 return ((SIO == (parport_read_status(pp->port) & SIO)) ? 0 : 1); in getmiso()
174 /*--------------------------------------------------------------------*/
176 #include "spi-bitbang-txrx.h"
214 master = spi_alloc_master(p->physport->dev, sizeof *pp); in spi_lm70llp_attach()
216 status = -ENOMEM; in spi_lm70llp_attach()
224 pp->bitbang.master = master; in spi_lm70llp_attach()
225 pp->bitbang.chipselect = lm70_chipselect; in spi_lm70llp_attach()
226 pp->bitbang.txrx_word[SPI_MODE_0] = lm70_txrx; in spi_lm70llp_attach()
227 pp->bitbang.flags = SPI_3WIRE; in spi_lm70llp_attach()
232 pp->port = p; in spi_lm70llp_attach()
239 status = -ENOMEM; in spi_lm70llp_attach()
242 pp->pd = pd; in spi_lm70llp_attach()
251 status = spi_bitbang_start(&pp->bitbang); in spi_lm70llp_attach()
253 dev_warn(&pd->dev, "spi_bitbang_start failed with status %d\n", in spi_lm70llp_attach()
264 strcpy(pp->info.modalias, "lm70"); in spi_lm70llp_attach()
265 pp->info.max_speed_hz = 6 * 1000 * 1000; in spi_lm70llp_attach()
266 pp->info.chip_select = 0; in spi_lm70llp_attach()
267 pp->info.mode = SPI_3WIRE | SPI_MODE_0; in spi_lm70llp_attach()
270 parport_write_data(pp->port, lm70_INIT); in spi_lm70llp_attach()
275 pp->info.controller_data = pp; in spi_lm70llp_attach()
276 pp->spidev_lm70 = spi_new_device(pp->bitbang.master, &pp->info); in spi_lm70llp_attach()
277 if (pp->spidev_lm70) in spi_lm70llp_attach()
278 dev_dbg(&pp->spidev_lm70->dev, "spidev_lm70 at %s\n", in spi_lm70llp_attach()
279 dev_name(&pp->spidev_lm70->dev)); in spi_lm70llp_attach()
281 dev_warn(&pd->dev, "spi_new_device failed\n"); in spi_lm70llp_attach()
282 status = -ENODEV; in spi_lm70llp_attach()
285 pp->spidev_lm70->bits_per_word = 8; in spi_lm70llp_attach()
291 spi_bitbang_stop(&pp->bitbang); in spi_lm70llp_attach()
294 parport_write_data(pp->port, 0); in spi_lm70llp_attach()
296 parport_release(pp->pd); in spi_lm70llp_attach()
309 if (!lm70llp || lm70llp->port != p) in spi_lm70llp_detach()
313 spi_bitbang_stop(&pp->bitbang); in spi_lm70llp_detach()
316 parport_write_data(pp->port, 0); in spi_lm70llp_detach()
318 parport_release(pp->pd); in spi_lm70llp_detach()
319 parport_unregister_device(pp->pd); in spi_lm70llp_detach()
321 spi_master_put(pp->bitbang.master); in spi_lm70llp_detach()
347 "Parport adapter for the National Semiconductor LM70 LLP eval board");