22 #include <linux/module.h>
23 #include <linux/kernel.h>
25 #include <linux/device.h>
26 #include <linux/parport.h>
74 #define DRVNAME "spi-lm70llp"
76 #define lm70_INIT 0xBE
145 static inline void setsck(
struct spi_device *
s,
int is_on)
155 static inline void setmosi(
struct spi_device *s,
int is_on)
170 static inline int getmiso(
struct spi_device *s)
194 return bitbang_txrx_be_cpha0(spi, nsecs, 0, 0, word, bits);
197 static void spi_lm70llp_attach(
struct parport *
p)
206 "%s: spi_lm70llp instance already loaded. Aborting.\n",
220 pp = spi_master_get_devdata(master);
225 pp->
bitbang.master = spi_master_get(master);
226 pp->
bitbang.chipselect = lm70_chipselect;
239 goto out_free_master;
245 goto out_parport_unreg;
253 "%s: spi_bitbang_start failed with status %d\n",
255 goto out_off_and_release;
265 pp->
info.max_speed_hz = 6 * 1000 * 1000;
266 pp->
info.chip_select = 0;
275 pp->
info.controller_data =
pp;
283 goto out_bitbang_stop;
300 (
void) spi_master_put(master);
302 pr_info(
"%s: spi_lm70llp probe fail, status %d\n",
DRVNAME, status);
305 static void spi_lm70llp_detach(
struct parport *p)
309 if (!lm70llp || lm70llp->
port != p)
329 .attach = spi_lm70llp_attach,
330 .detach = spi_lm70llp_detach,
333 static int __init init_spi_lm70llp(
void)
339 static void __exit cleanup_spi_lm70llp(
void)
347 "Parport adapter for the National Semiconductor LM70 LLP eval board");