linux/drivers/spi/spi-mpc512x-psc.c
<<
ue="/op/spa14. /op/form4. /opa ue="/o href="../linux+v3.9.1/drivers/spi/spi-mpc512x-psc.c">ue="/opimg src="../.static/gfx/right.png" alt=">>">uep/spa14.uepspa1 class="lxr_search">ue="ue="/opinput typue="/opinput typue="/opbutt> typSearch 4. /op/form4. p/spa14.uepspa1 class="lxr_prefs"4. /opa href="+prefs?return=drivers/spi/spi-mpc512x-psc.c"ue="/o onclick="return ajax_prefs();">ue="/oPrefs. /op/a>uep/spa14.="/o op/div4.="/o opform acv3.1="ajax+*" method="post" onsubmit="return false;">uepinput typu="/o op/form4.u="/o opdiv class="headingbott>m">. pdiv idopfile_contents"4
o o1p/a>pspa1 class="comment">/*p/spa14.o o2p/a>pspa1 class="comment"> * MPC512x PSC in SPI mode driver.p/spa14.o o3p/a>pspa1 class="comment"> *p/spa14.o o4p/a>pspa1 class="comment"> * Copyright (C) 2007,2008 Freescale Semiconductor Inc.p/spa14.o o5p/a>pspa1 class="comment"> * Original port from 52xx driver:p/spa14.o o6p/a>pspa1 class="comment"> *      Hongjun Chen <hong-jun.chen@freescale.com>p/spa14.o o7p/a>pspa1 class="comment"> *p/spa14.o o8p/a>pspa1 class="comment"> * Fork of mpc52xx_psc_spi.c:p/spa14.o o9p/a>pspa1 class="comment"> *      Copyright (C) 2006 TOPTICA Phot>
ics AG., Dragos Carpp/spa14.o   >
a>pspa1 class="comment"> *p/spa14.o 11p/a>pspa1 class="comment"> * This program is free software; you ca1 redistribute  it and/or modify itp/spa14.o 12p/a>pspa1 class="comment"> * under  the terms of  the GNU General  Public License as published by thep/spa14.o 13p/a>pspa1 class="comment"> * Free Software Foundav3.1;  either versn>
 2 of the  License, or (at yourp/spa14.o 14p/a>pspa1 class="comment"> *   v3.1) any later versn>
.p/spa14.o 15p/a>pspa1 class="comment"> */p/spa14.o 16p/a>.o 17p/a>#include <linux/module.hp/a>>.o 18p/a>#include <linux/kernel.hp/a>>.o 19p/a>#include <linux/init.hp/a>>.o 20p/a>#include <linux/errno.hp/a>>.o 21p/a>#include <linux/interrupt.hp/a>>.o 22p/a>#include <linux/of_address.hp/a>>.o 23p/a>#include <linux/of_platform.hp/a>>.o 24p/a>#include <linux/workqueue.hp/a>>.o 25p/a>#include <linux/complev3.1.hp/a>>.o 26p/a>#include <linux/io.hp/a>>.o 27p/a>#include <linux/delay.hp/a>>.o 28p/a>#include <linux/clk.hp/a>>.o 29p/a>#include <linux/spi/spi.hp/a>>.o 30p/a>#include <linux/fsl_devices.hp/a>>.o 31p/a>#include <asm/mpc52xx_psc.hp/a>>.o 32p/a>.o 33p/a>structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> {.o 34p/a>        void (*pa href="+code=cs_control" class="sref">cs_controlp/a>)(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>,opa href="+code=bool" class="sref">boolp/a> pa href="+code=on" class="sref">onp/a>);.o 35p/a>        pa href="+code=u32" class="sref">u32p/a>opa href="+code=sysclk" class="sref">sysclkp/a>;.o 36p/a>.o 37p/a>        pspa1 class="comment">/* driver internal data */p/spa14.o 38p/a>        structopa href="+code=mpc52xx_psc" class="sref">mpc52xx_pscp/a>opa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=psc" class="sref">pscp/a>;.o 39p/a>        structopa href="+code=mpc512x_psc_fifo" class="sref">mpc512x_psc_fifop/a>opa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=fifo" class="sref">fifop/a>;.o 40p/a>        unsigned intopa href="+code=irq" class="sref">irqp/a>;.o 41p/a>        pa href="+code=u8" class="sref">u8p/a>opa href="+code=bits_per_word" class="sref">bits_per_wordp/a>;.o 42p/a>        pa href="+code=u8" class="sref">u8p/a>opa href="+code=busy" class="sref">busyp/a>;.o 43p/a>        pa href="+code=u32" class="sref">u32p/a>opa href="+code=mclk" class="sref">mclkp/a>;.o 44p/a>        pa href="+code=u8" class="sref">u8p/a>opa href="+code=eofbyte" class="sref">eofbytep/a>;.o 45p/a>.o 46p/a>        structopa href="+code=workqueue_struct" class="sref">workqueue_structp/a> *pa href="+code=workqueue" class="sref">workqueuep/a>;.o 47p/a>        structopa href="+code=work_struct" class="sref">work_structp/a> pa href="+code=work" class="sref">workp/a>;.o 48p/a>.o 49p/a>        structopa href="+code=list_head" class="sref">list_headp/a> pa href="+code=queue" class="sref">queuep/a>;.o 50p/a>        pa href="+code=spinlock_t" class="sref">spinlock_tp/a> pa href="+code=lock" class="sref">lockp/a>;        pspa1 class="comment">/* Message queue lock */p/spa14.o 51p/a>.o 52p/a>        structopa href="+code=complev3.1" class="sref">complev3.1p/a> pa href="+code=done" class="sref">donep/a>;.o 53p/a>};.o 54p/a>.o 55p/a>pspa1 class="comment">/* controller state */p/spa14.o 56p/a>structopa href="+code=mpc512x_psc_spi_cs" class="sref">mpc512x_psc_spi_csp/a> {.o 57p/a>        intopa href="+code=bits_per_word" class="sref">bits_per_wordp/a>;.o 58p/a>        intopa href="+code=speed_hz" class="sref">speed_hzp/a>;.o 59p/a>};.o 60p/a>.o 61p/a>pspa1 class="comment">/* set clock freq, clock ramp, bits per workp/spa14.o 62p/a>pspa1 class="comment"> * if t is NULL the1 reset the  
  o 63p/a>pspa1 class="comment"> */p/spa14.o 64p/a>static intopa href="+code=mpc512x_psc_spi_transfer_setup" class="sref">mpc512x_psc_spi_transfer_setupp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>,.o 65p/a>                                          structopa href="+code=spi_transfer" class="sref">spi_transferp/a> *pa href="+code=t" class="sref">tp/a>).o 66p/a>{.o 67p/a>        structopa href="+code=mpc512x_psc_spi_cs" class="sref">mpc512x_psc_spi_csp/a> *pa href="+code=cs" class="sref">csp/a> =opa href="+code=spi" class="sref">spip/a>->pa href="+code=controller_state" class="sref">controller_statep/a>;.o 68p/a>.o 69p/a>        pa href="+code=cs" class="sref">csp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a> =o(pa href="+code=t" class="sref">tp/a> && pa href="+code=t" class="sref">tp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a>).o 70p/a>            ? pa href="+code=t" class="sref">tp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a> :opa href="+code=spi" class="sref">spip/a>->pa href="+code=max_speed_hz" class="sref">max_speed_hzp/a>;.o 71p/a>        pa href="+code=cs" class="sref">csp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> =o(pa href="+code=t" class="sref">tp/a> && pa href="+code=t" class="sref">tp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a>).o 72p/a>            ? pa href="+code=t" class="sref">tp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> :opa href="+code=spi" class="sref">spip/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a>;.o 73p/a>        pa href="+code=cs" class="sref">csp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> =o((pa href="+code=cs" class="sref">csp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> + 7) / 8) * 8;.o 74p/a>        return 0;.o 75p/a>}.o 76p/a>.o 77p/a>static void pa href="+code=mpc512x_psc_spi_acv3vate_cs" class="sref">mpc512x_psc_spi_acv3vate_csp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>).o 78p/a>{.o 79p/a>        structopa href="+code=mpc512x_psc_spi_cs" class="sref">mpc512x_psc_spi_csp/a> *pa href="+code=cs" class="sref">csp/a> =opa href="+code=spi" class="sref">spip/a>->pa href="+code=controller_state" class="sref">controller_statep/a>;.o 80p/a>        structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=spi" class="sref">spip/a>->pa href="+code=master" class="sref">masterp/a>);.o 81p/a>        structopa href="+code=mpc52xx_psc" class="sref">mpc52xx_pscp/a>opa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=psc" class="sref">pscp/a> =opa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>;.o 82p/a>        pa href="+code=u32" class="sref">u32p/a>opa href="+code=sicr" class="sref">sicrp/a>;.o 83p/a>        pa href="+code=u32" class="sref">u32p/a>opa href="+code=ccr" class="sref">ccrp/a>;.o 84p/a>        pa href="+code=u16" class="sref">u16p/a>opa href="+code=bclkdiv" class="sref">bclkdivp/a>;.o 85p/a>.o 86p/a>        pa href="+code=sicr" class="sref">sicrp/a> =opa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=sicr" class="sref">sicrp/a>);.o 87p/a>.o 88p/a>        pspa1 class="comment">/* Set clock phase and polarity */p/spa14.o 89p/a>        ifo(pa href="+code=spi" class="sref">spip/a>->pa href="+code=mode" class="sref">modep/a> &opa href="+code=SPI_CPHA" class="sref">SPI_CPHAp/a>).o 90p/a>                pa href="+code=sicr" class="sref">sicrp/a> |= 0x00001000;.o 91p/a>        else.o 92p/a>                pa href="+code=sicr" class="sref">sicrp/a> &= ~0x00001000;.o 93p/a>.o 94p/a>        ifo(pa href="+code=spi" class="sref">spip/a>->pa href="+code=mode" class="sref">modep/a> &opa href="+code=SPI_CPOL" class="sref">SPI_CPOLp/a>).o 95p/a>                pa href="+code=sicr" class="sref">sicrp/a> |= 0x00002000;.o 96p/a>        else.o 97p/a>                pa href="+code=sicr" class="sref">sicrp/a> &= ~0x00002000;.o 98p/a>.o 99p/a>        ifo(pa href="+code=spi" class="sref">spip/a>->pa href="+code=mode" class="sref">modep/a> &opa href="+code=SPI_LSB_FIRST" class="sref">SPI_LSB_FIRSTp/a>).o100p/a>                pa href="+code=sicr" class="sref">sicrp/a> |= 0x10000000;.o101p/a>        else.o102p/a>                pa href="+code=sicr" class="sref">sicrp/a> &= ~0x10000000;.o103p/a>        pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=sicr" class="sref">sicrp/a>,opa href="+code=sicr" class="sref">sicrp/a>);.o104p/a>.o105p/a>        pa href="+code=ccr" class="sref">ccrp/a> =opa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=ccr" class="sref">ccrp/a>);.o106p/a>        pa href="+code=ccr" class="sref">ccrp/a> &= 0xFF000000;.o107p/a>        ifo(pa href="+code=cs" class="sref">csp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a>).o108p/a>                pa href="+code=bclkdiv" class="sref">bclkdivp/a> =o(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=mclk" class="sref">mclkp/a> / pa href="+code=cs" class="sref">csp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a>) - 1;.o109p/a>        else.o110p/a>                pa href="+code=bclkdiv" class="sref">bclkdivp/a> =o(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=mclk" class="sref">mclkp/a> / 1000000) - 1;    pspa1 class="comment">/* default 1MHz */p/spa14.o111p/a>.o112p/a>        pa href="+code=ccr" class="sref">ccrp/a> |=o(((pa href="+code=bclkdiv" class="sref">bclkdivp/a> &o0xff) << 16) |o(((pa href="+code=bclkdiv" class="sref">bclkdivp/a> >> 8) &o0xff) << 8));.o113p/a>        pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=ccr" class="sref">ccrp/a>,opa href="+code=ccr" class="sref">ccrp/a>);.o114p/a>        pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> =opa href="+code=cs" class="sref">csp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a>;.o115p/a>.o116p/a>        ifo(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=cs_control" class="sref">cs_controlp/a>).o117p/a>                pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=cs_control" class="sref">cs_controlp/a>(pa href="+code=spi" class="sref">spip/a>,o(pa href="+code=spi" class="sref">spip/a>->pa href="+code=mode" class="sref">modep/a> &opa href="+code=SPI_CS_HIGH" class="sref">SPI_CS_HIGHp/a>) ? 1 : 0);.o118p/a>}.o119p/a>.o120p/a>static void pa href="+code=mpc512x_psc_spi_deacv3vate_cs" class="sref">mpc512x_psc_spi_deacv3vate_csp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>).o121p/a>{.o122p/a>        structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=spi" class="sref">spip/a>->pa href="+code=master" class="sref">masterp/a>);.o123p/a>.o124p/a>        ifo(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=cs_control" class="sref">cs_controlp/a>).o125p/a>                pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=cs_control" class="sref">cs_controlp/a>(pa href="+code=spi" class="sref">spip/a>,o(pa href="+code=spi" class="sref">spip/a>->pa href="+code=mode" class="sref">modep/a> &opa href="+code=SPI_CS_HIGH" class="sref">SPI_CS_HIGHp/a>) ? 0 : 1);.o126p/a>.o127p/a>}.o128p/a>.o129p/a>pspa1 class="comment">/* extracv and scale size field in txsz or rxsz */p/spa14.o130p/a>#defineopa href="+code=MPC512x_PSC_FIFO_SZ" class="sref">MPC512x_PSC_FIFO_SZp/a>(pa href="+code=sz" class="sref">szp/a>) ((pa href="+code=sz" class="sref">szp/a> &o0x7ff) << 2);.o131p/a>.o132p/a>#defineopa href="+code=EOFBYTE" class="sref">EOFBYTEp/a> 1.o133p/a>.o134p/a>static intopa href="+code=mpc512x_psc_spi_transfer_rxtx" class="sref">mpc512x_psc_spi_transfer_rxtxp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>,.o135p/a>                                         structopa href="+code=spi_transfer" class="sref">spi_transferp/a> *pa href="+code=t" class="sref">tp/a>).o136p/a>{.o137p/a>        structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=spi" class="sref">spip/a>->pa href="+code=master" class="sref">masterp/a>);.o138p/a>        structopa href="+code=mpc52xx_psc" class="sref">mpc52xx_pscp/a>opa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=psc" class="sref">pscp/a> =opa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>;.o139p/a>        structopa href="+code=mpc512x_psc_fifo" class="sref">mpc512x_psc_fifop/a>opa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=fifo" class="sref">fifop/a> =opa href="+code=mps" class="sref">mpsp/a>->pa href="+code=fifo" class="sref">fifop/a>;.o140p/a>        pa href="+code=size_t" class="sref">size_tp/a>opa href="+code=le1" class="sref">le1p/a> =opa href="+code=t" class="sref">tp/a>->pa href="+code=le1" class="sref">le1p/a>;.o141p/a>        pa href="+code=u8" class="sref">u8p/a>o*pa href="+code=tx_buf" class="sref">tx_bufp/a> =o(pa href="+code=u8" class="sref">u8p/a>o*)pa href="+code=t" class="sref">tp/a>->pa href="+code=tx_buf" class="sref">tx_bufp/a>;.o142p/a>        pa href="+code=u8" class="sref">u8p/a>o*pa href="+code=rx_buf" class="sref">rx_bufp/a> =o(pa href="+code=u8" class="sref">u8p/a>o*)pa href="+code=t" class="sref">tp/a>->pa href="+code=rx_buf" class="sref">rx_bufp/a>;.o143p/a>.o144p/a>        ifo(!pa href="+code=tx_buf" class="sref">tx_bufp/a> && !pa href="+code=rx_buf" class="sref">rx_bufp/a> && pa href="+code=t" class="sref">tp/a>->pa href="+code=le1" class="sref">le1p/a>).o145p/a>                return -pa href="+code=EINVAL" class="sref">EINVALp/a>;.o146p/a>.o147p/a>        pspa1 class="comment">/* Zero MR2 */p/spa14.o148p/a>        pa href="+code=in_8" class="sref">in_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=mode" class="sref">modep/a>);.o149p/a>        pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=mode" class="sref">modep/a>, 0x0);.o150p/a>.o151p/a>        whileo(pa href="+code=le1" class="sref">le1p/a>) {.o152p/a>                intopa href="+code=count" class="sref">countp/a>;.o153p/a>                intopa href="+code=i" class="sref">ip/a>;.o154p/a>                pa href="+code=u8" class="sref">u8p/a>opa href="+code=data" class="sref">datap/a>;.o155p/a>                pa href="+code=size_t" class="sref">size_tp/a>opa href="+code=fifosz" class="sref">fifoszp/a>;.o156p/a>                intopa href="+code=rxcount" class="sref">rxcountp/a>;.o157p/a>.o158p/a>                pspa1 class="comment">/*p/spa14.o159p/a>pspa1 class="comment">                 * The number of bytes that ca1 be sent at a timep/spa14.o16 >
a>pspa1 class="comment">                 * depends >
 the fifo size.p/spa14.o161p/a>pspa1 class="comment">                 */p/spa14.o162p/a>                pa href="+code=fifosz" class="sref">fifoszp/a> =opa href="+code=MPC512x_PSC_FIFO_SZ" class="sref">MPC512x_PSC_FIFO_SZp/a>(pa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txsz" class="sref">txszp/a>));.o163p/a>                pa href="+code=count" class="sref">countp/a> =opa href="+code=mi1" class="sref">mi1p/a>(pa href="+code=fifosz" class="sref">fifoszp/a>,opa href="+code=le1" class="sref">le1p/a>);.o164p/a>.o165p/a>                for (pa href="+code=i" class="sref">ip/a> =opa href="+code=count" class="sref">countp/a>;opa href="+code=i" class="sref">ip/a> > 0;opa href="+code=i" class="sref">ip/a>--) {.o166p/a>                        pa href="+code=data" class="sref">datap/a> =opa href="+code=tx_buf" class="sref">tx_bufp/a> ?o*pa href="+code=tx_buf" class="sref">tx_bufp/a>++ : 0;.o167p/a>                        ifo(pa href="+code=le1" class="sref">le1p/a> ==opa href="+code=EOFBYTE" class="sref">EOFBYTEp/a> && pa href="+code=t" class="sref">tp/a>->pa href="+code=cs_change" class="sref">cs_changep/a>).o168p/a>                                pa href="+code=setbits32" class="sref">setbits32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txcmd" class="sref">txcmdp/a>,opa href="+code=MPC512x_PSC_FIFO_EOF" class="sref">MPC512x_PSC_FIFO_EOFp/a>);.o169p/a>                        pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txdata_8" class="sref">txdata_8p/a>,opa href="+code=data" class="sref">datap/a>);.o170p/a>                        pa href="+code=le1" class="sref">le1p/a>--;.o171p/a>                }.o172p/a>.o173p/a>                pa href="+code=INIT_COMPLETION" class="sref">INIT_COMPLETIONp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=done" class="sref">donep/a>);.o174p/a>.o175p/a>                pspa1 class="comment">/* interrupt >
 tx fifo empty */p/spa14.o176p/a>                pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txisr" class="sref">txisrp/a>,opa href="+code=MPC512x_PSC_FIFO_EMPTY" class="sref">MPC512x_PSC_FIFO_EMPTYp/a>);.o177p/a>                pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=tximr" class="sref">tximrp/a>,opa href="+code=MPC512x_PSC_FIFO_EMPTY" class="sref">MPC512x_PSC_FIFO_EMPTYp/a>);.o178p/a>.o179p/a>                pspa1 class="comment">/* enable transmiter/receiver */p/spa14.o180p/a>                pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=command" class="sref">commandp/a>,.o181p/a>                      pa href="+code=MPC52xx_PSC_TX_ENABLE" class="sref">MPC52xx_PSC_TX_ENABLEp/a> | pa href="+code=MPC52xx_PSC_RX_ENABLE" class="sref">MPC52xx_PSC_RX_ENABLEp/a>);.o182p/a>.o183p/a>                pa href="+code=wait_for_complev3.1" class="sref">wait_for_complev3.1p/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=done" class="sref">donep/a>);.o184p/a>.o185p/a>                pa href="+code=mdelay" class="sref">mdelayp/a>(1);.o186p/a>.o187p/a>                pspa1 class="comment">/* rx fifo should have count bytes in it */p/spa14.o188p/a>                pa href="+code=rxcount" class="sref">rxcountp/a> =opa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxcnt" class="sref">rxcntp/a>);.o189p/a>                ifo(pa href="+code=rxcount" class="sref">rxcountp/a> !=opa href="+code=count" class="sref">countp/a>).o190p/a>                        pa href="+code=mdelay" class="sref">mdelayp/a>(1);.o191p/a>.o192p/a>                pa href="+code=rxcount" class="sref">rxcountp/a> =opa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxcnt" class="sref">rxcntp/a>);.o193p/a>                ifo(pa href="+code=rxcount" class="sref">rxcountp/a> !=opa href="+code=count" class="sref">countp/a>) {.o194p/a>                        pa href="+code=dev_war1" class="sref">dev_war1p/a>(&pa href="+code=spi" class="sref">spip/a>->pa href="+code=dev" class="sref">devp/a>,opspa1 class="string">"expected %d bytes in rx fifo "p/spa14.o195p/a>                                 pspa1 class="string">"but got %d\n"p/spa14,opa href="+code=count" class="sref">countp/a>,opa href="+code=rxcount" class="sref">rxcountp/a>);.o196p/a>                }.o197p/a>.o198p/a>                pa href="+code=rxcount" class="sref">rxcountp/a> =opa href="+code=mi1" class="sref">mi1p/a>(pa href="+code=rxcount" class="sref">rxcountp/a>,opa href="+code=count" class="sref">countp/a>);.o199p/a>                for (pa href="+code=i" class="sref">ip/a> =opa href="+code=rxcount" class="sref">rxcountp/a>;opa href="+code=i" class="sref">ip/a> > 0;opa href="+code=i" class="sref">ip/a>--) {.o200p/a>                        pa href="+code=data" class="sref">datap/a> =opa href="+code=in_8" class="sref">in_8p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxdata_8" class="sref">rxdata_8p/a>);.o201p/a>                        ifo(pa href="+code=rx_buf" class="sref">rx_bufp/a>).o202p/a>                                *pa href="+code=rx_buf" class="sref">rx_bufp/a>++ =opa href="+code=data" class="sref">datap/a>;.o203p/a>                }.o204p/a>                whileo(pa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxcnt" class="sref">rxcntp/a>)) {.o205p/a>                        pa href="+code=in_8" class="sref">in_8p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxdata_8" class="sref">rxdata_8p/a>);.o206p/a>                }.o207p/a>.o208p/a>                pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=command" class="sref">commandp/a>,.o209p/a>                      pa href="+code=MPC52xx_PSC_TX_DISABLE" class="sref">MPC52xx_PSC_TX_DISABLEp/a> | pa href="+code=MPC52xx_PSC_RX_DISABLE" class="sref">MPC52xx_PSC_RX_DISABLEp/a>);.o210p/a>        }.o211p/a>        pspa1 class="comment">/* disable transmiter/receiver and fifo interrupt */p/spa14.o212p/a>        pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=command" class="sref">commandp/a>, pa href="+code=MPC52xx_PSC_TX_DISABLE" class="sref">MPC52xx_PSC_TX_DISABLEp/a> | pa href="+code=MPC52xx_PSC_RX_DISABLE" class="sref">MPC52xx_PSC_RX_DISABLEp/a>);.o213p/a>        pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=tximr" class="sref">tximrp/a>,o0);.o214p/a>        return 0;.o215p/a>}.o216p/a>.o217p/a>static void pa href="+code=mpc512x_psc_spi_work" class="sref">mpc512x_psc_spi_workp/a>(structopa href="+code=work_struct" class="sref">work_structp/a> *pa href="+code=work" class="sref">workp/a>).o218p/a>{.o219p/a>        structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=container_of" class="sref">container_ofp/a>(pa href="+code=work" class="sref">workp/a>,.o220p/a>                                                   structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a>,.o221p/a>                                                   pa href="+code=work" class="sref">workp/a>);.o222p/a>.o223p/a>        pa href="+code=spin_lock_irq" class="sref">spin_lock_irqp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>);.o224p/a>        pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=busy" class="sref">busyp/a> =o1;.o225p/a>        whileo(!pa href="+code=list_empty" class="sref">list_emptyp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=queue" class="sref">queuep/a>)) {.o226p/a>                structopa href="+code=spi_message" class="sref">spi_messagep/a> *pa href="+code=m" class="sref">mp/a>;.o227p/a>                structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>;.o228p/a>                structopa href="+code=spi_transfer" class="sref">spi_transferp/a> *pa href="+code=t" class="sref">tp/a> =opa href="+code=NULL" class="sref">NULLp/a>;.o229p/a>                unsigned pa href="+code=cs_change" class="sref">cs_changep/a>;.o230p/a>                intopa href="+code=status" class="sref">statusp/a>;.o231p/a>.o232p/a>                pa href="+code=m" class="sref">mp/a> =opa href="+code=container_of" class="sref">container_ofp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=queue" class="sref">queuep/a>.pa href="+code=next" class="sref">nextp/a>,ostructopa href="+code=spi_message" class="sref">spi_messagep/a>, pa href="+code=queue" class="sref">queuep/a>);.o233p/a>                pa href="+code=list_del_init" class="sref">list_del_initp/a>(&pa href="+code=m" class="sref">mp/a>->pa href="+code=queue" class="sref">queuep/a>);.o234p/a>                pa href="+code=spin_unlock_irq" class="sref">spin_unlock_irqp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>);.o235p/a>.o236p/a>                pa href="+code=spi" class="sref">spip/a> =opa href="+code=m" class="sref">mp/a>->pa href="+code=spi" class="sref">spip/a>;.o237p/a>                pa href="+code=cs_change" class="sref">cs_changep/a> =o1;.o238p/a>                pa href="+code=status" class="sref">statusp/a> =o0;.o239p/a>                pa href="+code=list_for_each_entry" class="sref">list_for_each_entryp/a>(pa href="+code=t" class="sref">tp/a>, &pa href="+code=m" class="sref">mp/a>->pa href="+code=transfers" class="sref">transfersp/a>, pa href="+code=transfer_list" class="sref">transfer_listp/a>) {.o240p/a>                        ifo(pa href="+code=t" class="sref">tp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> || pa href="+code=t" class="sref">tp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a>) {.o241p/a>                                pa href="+code=status" class="sref">statusp/a> =opa href="+code=mpc512x_psc_spi_transfer_setup" class="sref">mpc512x_psc_spi_transfer_setupp/a>(pa href="+code=spi" class="sref">spip/a>, pa href="+code=t" class="sref">tp/a>);.o242p/a>                                ifo(pa href="+code=status" class="sref">statusp/a> < 0).o243p/a>                                        break;.o244p/a>                        }.o245p/a>.o246p/a>                        ifo(pa href="+code=cs_change" class="sref">cs_changep/a>).o247p/a>                                pa href="+code=mpc512x_psc_spi_acv3vate_cs" class="sref">mpc512x_psc_spi_acv3vate_csp/a>(pa href="+code=spi" class="sref">spip/a>);.o248p/a>                        pa href="+code=cs_change" class="sref">cs_changep/a> =opa href="+code=t" class="sref">tp/a>->pa href="+code=cs_change" class="sref">cs_changep/a>;.o249p/a>.o250p/a>                        pa href="+code=status" class="sref">statusp/a> =opa href="+code=mpc512x_psc_spi_transfer_rxtx" class="sref">mpc512x_psc_spi_transfer_rxtxp/a>(pa href="+code=spi" class="sref">spip/a>, pa href="+code=t" class="sref">tp/a>);.o251p/a>                        ifo(pa href="+code=status" class="sref">statusp/a>).o252p/a>                                break;.o253p/a>                        pa href="+code=m" class="sref">mp/a>->pa href="+code=acvual_length" class="sref">acvual_lengthp/a> +=opa href="+code=t" class="sref">tp/a>->pa href="+code=le1" class="sref">le1p/a>;.o254p/a>.o255p/a>                        ifo(pa href="+code=t" class="sref">tp/a>->pa href="+code=delay_usecs" class="sref">delay_usecsp/a>).o256p/a>                                pa href="+code=udelay" class="sref">udelayp/a>(pa href="+code=t" class="sref">tp/a>->pa href="+code=delay_usecs" class="sref">delay_usecsp/a>);.o257p/a>.o258p/a>                        ifo(pa href="+code=cs_change" class="sref">cs_changep/a>).o259p/a>                                pa href="+code=mpc512x_psc_spi_deacv3vate_cs" class="sref">mpc512x_psc_spi_deacv3vate_csp/a>(pa href="+code=spi" class="sref">spip/a>);.o260p/a>                }.o261p/a>.o262p/a>                pa href="+code=m" class="sref">mp/a>->pa href="+code=status" class="sref">statusp/a> =opa href="+code=status" class="sref">statusp/a>;.o263p/a>                pa href="+code=m" class="sref">mp/a>->pa href="+code=compleve" class="sref">complevep/a>(pa href="+code=m" class="sref">mp/a>->pa href="+code=context" class="sref">contextp/a>);.o264p/a>.o265p/a>                ifo(pa href="+code=status" class="sref">statusp/a> || !pa href="+code=cs_change" class="sref">cs_changep/a>).o266p/a>                        pa href="+code=mpc512x_psc_spi_deacv3vate_cs" class="sref">mpc512x_psc_spi_deacv3vate_csp/a>(pa href="+code=spi" class="sref">spip/a>);.o267p/a>.o268p/a>                pa href="+code=mpc512x_psc_spi_transfer_setup" class="sref">mpc512x_psc_spi_transfer_setupp/a>(pa href="+code=spi" class="sref">spip/a>, pa href="+code=NULL" class="sref">NULLp/a>);.o269p/a>.o270p/a>                pa href="+code=spin_lock_irq" class="sref">spin_lock_irqp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>);.o271p/a>        }.o272p/a>        pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=busy" class="sref">busyp/a> =o0;.o273p/a>        pa href="+code=spin_unlock_irq" class="sref">spin_unlock_irqp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>);.o274p/a>}.o275p/a>.o276p/a>static intopa href="+code=mpc512x_psc_spi_setup" class="sref">mpc512x_psc_spi_setupp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>).o277p/a>{.o278p/a>        structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=spi" class="sref">spip/a>->pa href="+code=master" class="sref">masterp/a>);.o279p/a>        structopa href="+code=mpc512x_psc_spi_cs" class="sref">mpc512x_psc_spi_csp/a> *pa href="+code=cs" class="sref">csp/a> =opa href="+code=spi" class="sref">spip/a>->pa href="+code=controller_state" class="sref">controller_statep/a>;.o280p/a>        unsigned long pa href="+code=flags" class="sref">flagsp/a>;.o281p/a>.o282p/a>        ifo(pa href="+code=spi" class="sref">spip/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> % 8).o283p/a>                return -pa href="+code=EINVAL" class="sref">EINVALp/a>;.o284p/a>.o285p/a>        ifo(!pa href="+code=cs" class="sref">csp/a>) {.o286p/a>                pa href="+code=cs" class="sref">csp/a> =opa href="+code=kzalloc" class="sref">kzallocp/a>(sizeof *pa href="+code=cs" class="sref">csp/a>, pa href="+code=GFP_KERNEL" class="sref">GFP_KERNELp/a>);.o287p/a>                ifo(!pa href="+code=cs" class="sref">csp/a>).o288p/a>                        return -pa href="+code=ENOMEM" class="sref">ENOMEMp/a>;.o289p/a>                pa href="+code=spi" class="sref">spip/a>->pa href="+code=controller_state" class="sref">controller_statep/a> =opa href="+code=cs" class="sref">csp/a>;.o290p/a>        }.o291p/a>.o292p/a>        pa href="+code=cs" class="sref">csp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> =opa href="+code=spi" class="sref">spip/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a>;.o293p/a>        pa href="+code=cs" class="sref">csp/a>->pa href="+code=speed_hz" class="sref">speed_hzp/a> =opa href="+code=spi" class="sref">spip/a>->pa href="+code=max_speed_hz" class="sref">max_speed_hzp/a>;.o294p/a>.o295p/a>        pa href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsavep/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>, pa href="+code=flags" class="sref">flagsp/a>);.o296p/a>        ifo(!pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=busy" class="sref">busyp/a>).o297p/a>                pa href="+code=mpc512x_psc_spi_deacv3vate_cs" class="sref">mpc512x_psc_spi_deacv3vate_csp/a>(pa href="+code=spi" class="sref">spip/a>);.o298p/a>        pa href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestorep/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>, pa href="+code=flags" class="sref">flagsp/a>);.o299p/a>.o300p/a>        return 0;.o301p/a>}.o302p/a>.o303p/a>static intopa href="+code=mpc512x_psc_spi_transfer" class="sref">mpc512x_psc_spi_transferp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>,.o304p/a>                                    structopa href="+code=spi_message" class="sref">spi_messagep/a> *pa href="+code=m" class="sref">mp/a>).o305p/a>{.o306p/a>        structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=spi" class="sref">spip/a>->pa href="+code=master" class="sref">masterp/a>);.o307p/a>        unsigned long pa href="+code=flags" class="sref">flagsp/a>;.o308p/a>.o309p/a>        pa href="+code=m" class="sref">mp/a>->pa href="+code=acvual_length" class="sref">acvual_lengthp/a> =o0;.o310p/a>        pa href="+code=m" class="sref">mp/a>->pa href="+code=status" class="sref">statusp/a> =o-pa href="+code=EINPROGRESS" class="sref">EINPROGRESSp/a>;.o311p/a>.o312p/a>        pa href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsavep/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>, pa href="+code=flags" class="sref">flagsp/a>);.o313p/a>        pa href="+code=list_add_tail" class="sref">list_add_tailp/a>(&pa href="+code=m" class="sref">mp/a>->pa href="+code=queue" class="sref">queuep/a>, &pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=queue" class="sref">queuep/a>);.o314p/a>        pa href="+code=queue_work" class="sref">queue_workp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=workqueue" class="sref">workqueuep/a>, &pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=work" class="sref">workp/a>);.o315p/a>        pa href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestorep/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>, pa href="+code=flags" class="sref">flagsp/a>);.o316p/a>.o317p/a>        return 0;.o318p/a>}.o319p/a>.o320p/a>static void pa href="+code=mpc512x_psc_spi_cleanup" class="sref">mpc512x_psc_spi_cleanupp/a>(structopa href="+code=spi_device" class="sref">spi_devicep/a> *pa href="+code=spi" class="sref">spip/a>).o321p/a>{.o322p/a>        pa href="+code=kfree" class="sref">kfreep/a>(pa href="+code=spi" class="sref">spip/a>->pa href="+code=controller_state" class="sref">controller_statep/a>);.o323p/a>}.o324p/a>.o325p/a>static intopa href="+code=mpc512x_psc_spi_port_config" class="sref">mpc512x_psc_spi_port_configp/a>(structopa href="+code=spi_master" class="sref">spi_masterp/a> *pa href="+code=master" class="sref">masterp/a>,.o326p/a>                                       structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a>).o327p/a>{.o328p/a>        structopa href="+code=mpc52xx_psc" class="sref">mpc52xx_pscp/a> pa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=psc" class="sref">pscp/a> =opa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>;.o329p/a>        structopa href="+code=mpc512x_psc_fifo" class="sref">mpc512x_psc_fifop/a> pa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=fifo" class="sref">fifop/a> =opa href="+code=mps" class="sref">mpsp/a>->pa href="+code=fifo" class="sref">fifop/a>;.o330p/a>        structopa href="+code=clk" class="sref">clkp/a> *pa href="+code=spiclk" class="sref">spiclkp/a>;.o331p/a>        intopa href="+code=ret" class="sref">retp/a> =o0;.o332p/a>        charopa href="+code=nam<" class="sref">nam

[32];.o333p/a> pa href="+code=u32" class="sref">u32p/a> pa href="+code=sicr" class="sref">sicrp/a>;.o334p/a> pa href="+code=u32" class="sref">u32p/a> pa href="+code=ccr" class="sref">ccrp/a>;.o335p/a> pa href="+code=u16" class="sref">u16p/a> pa href="+code=bclkdiv" class="sref">bclkdivp/a>;.o336p/a>.o337p/a> pa href="+code=sprintf" class="sref">sprintfp/a>(pa href="+code=nam<" class="sref">nam

,opspa1 class="string">"psc%d_mclk"p/spa14,opa href="+code=master" class="sref">masterp/a>->pa href="+code=bus_num" class="sref">bus_nump/a>);.o338p/a> pa href="+code=spiclk" class="sref">spiclkp/a> =opa href="+code=clk_get" class="sref">clk_getp/a>(&pa href="+code=master" class="sref">masterp/a>->pa href="+code=dev" class="sref">devp/a>,opa href="+code=nam<" class="sref">nam

);.o339p/a> pa href="+code=clk_enable" class="sref">clk_enablep/a>(pa href="+code=spiclk" class="sref">spiclkp/a>);.o340p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=mclk" class="sref">mclkp/a> =opa href="+code=clk_get_rate" class="sref">clk_get_ratep/a>(pa href="+code=spiclk" class="sref">spiclkp/a>);.o341p/a> pa href="+code=clk_put" class="sref">clk_putp/a>(pa href="+code=spiclk" class="sref">spiclkp/a>);.o342p/a>.o343p/a> pspa1 class="comment">/* Reset the PSC into a known state */p/spa14.o344p/a> pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=command" class="sref">commandp/a>, pa href="+code=MPC52xx_PSC_RST_RX" class="sref">MPC52xx_PSC_RST_RXp/a>);.o345p/a> pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=command" class="sref">commandp/a>, pa href="+code=MPC52xx_PSC_RST_TX" class="sref">MPC52xx_PSC_RST_TXp/a>);.o346p/a> pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=command" class="sref">commandp/a>, pa href="+code=MPC52xx_PSC_TX_DISABLE" class="sref">MPC52xx_PSC_TX_DISABLEp/a> | pa href="+code=MPC52xx_PSC_RX_DISABLE" class="sref">MPC52xx_PSC_RX_DISABLEp/a>);.o347p/a>.o348p/a> pspa1 class="comment">/* Disable psc interrupts all useful interrupts are in fifo */p/spa14.o349p/a> pa href="+code=out_be16" class="sref">out_be16p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=isr_imr" class="sref">isr_imrp/a>.pa href="+code=imr" class="sref">imrp/a>,o0);.o350p/a>.o351p/a> pspa1 class="comment">/* Disable fifo interrupts, will be enabled later */p/spa14.o352p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=tximr" class="sref">tximrp/a>,o0);.o353p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rximr" class="sref">rximrp/a>,o0);.o354p/a>.o355p/a> pspa1 class="comment">/* Setup fifo slice address and size */p/spa14.o356p/a> pspa1 class="comment">/*out_be32(&fifo->txsz,o0x0fe00004);*/p/spa14.o357p/a> pspa1 class="comment">/*out_be32(&fifo->rxsz,o0x0ff00004);*/p/spa14.o358p/a>.o359p/a> pa href="+code=sicr" class="sref">sicrp/a> =oo0x01000000 | pspa1 class="comment">/* SIM =o0001 -- 8 bit */p/spa14.o360p/a> 0x00800000 | pspa1 class="comment">/* GenClk =o1 -- internal clk */p/spa14.o361p/a> 0x00008000 | pspa1 class="comment">/* SPI =o1 */p/spa14.o362p/a> 0x00004000 | pspa1 class="comment">/* MSTR =o1 -- SPI master */p/spa14.o363p/a> 0x00000800; pspa1 class="comment">/* UseEOF =o1 -- SS low until EOF */p/spa14.o364p/a>.o365p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=sicr" class="sref">sicrp/a>, pa href="+code=sicr" class="sref">sicrp/a>);.o366p/a>.o367p/a> pa href="+code=ccr" class="sref">ccrp/a> =opa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=ccr" class="sref">ccrp/a>);.o368p/a> pa href="+code=ccr" class="sref">ccrp/a> &=o0xFF000000;.o369p/a> pa href="+code=bclkdiv" class="sref">bclkdivp/a> =o(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=mclk" class="sref">mclkp/a> / 1000000) - 1; pspa1 class="comment">/* default 1MHz */p/spa14.o370p/a> pa href="+code=ccr" class="sref">ccrp/a> |=o(((pa href="+code=bclkdiv" class="sref">bclkdivp/a> &o0xff) << 16) | (((pa href="+code=bclkdiv" class="sref">bclkdivp/a> >> 8) &o0xff) << 8));.o371p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=ccr" class="sref">ccrp/a>, pa href="+code=ccr" class="sref">ccrp/a>);.o372p/a>.o373p/a> pspa1 class="comment">/* Set 2ms DTL delay */p/spa14.o374p/a> pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=ctur" class="sref">cturp/a>,o0x00);.o375p/a> pa href="+code=out_8" class="sref">out_8p/a>(&pa href="+code=psc" class="sref">pscp/a>->pa href="+code=ctlr" class="sref">ctlrp/a>,o0x82);.o376p/a>.o377p/a> pspa1 class="comment">/* we don't use the alarms */p/spa14.o378p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxalarm" class="sref">rxalarmp/a>,o0xfff);.o379p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txalarm" class="sref">txalarmp/a>,o0);.o380p/a>.o381p/a> pspa1 class="comment">/* Enable FIFO slices for Rx/Tx */p/spa14.o382p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=rxcmd" class="sref">rxcmdp/a>,.o383p/a> pa href="+code=MPC512x_PSC_FIFO_ENABLE_SLICE" class="sref">MPC512x_PSC_FIFO_ENABLE_SLICEp/a> | pa href="+code=MPC512x_PSC_FIFO_ENABLE_DMA" class="sref">MPC512x_PSC_FIFO_ENABLE_DMAp/a>);.o384p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txcmd" class="sref">txcmdp/a>,.o385p/a> pa href="+code=MPC512x_PSC_FIFO_ENABLE_SLICE" class="sref">MPC512x_PSC_FIFO_ENABLE_SLICEp/a> | pa href="+code=MPC512x_PSC_FIFO_ENABLE_DMA" class="sref">MPC512x_PSC_FIFO_ENABLE_DMAp/a>);.o386p/a>.o387p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=bits_per_word" class="sref">bits_per_wordp/a> =o8;.o388p/a>.o389p/a> return pa href="+code=ret" class="sref">retp/a>;.o390p/a>}.o391p/a>.o392p/a>static pa href="+code=irqreturn_t" class="sref">irqreturn_tp/a> pa href="+code=mpc512x_psc_spi_isr" class="sref">mpc512x_psc_spi_isrp/a>(intopa href="+code=irq" class="sref">irqp/a>, void *pa href="+code=dev_id" class="sref">dev_idp/a>).o393p/a>{.o394p/a> structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =o(structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *)pa href="+code=dev_id" class="sref">dev_idp/a>;.o395p/a> structopa href="+code=mpc512x_psc_fifo" class="sref">mpc512x_psc_fifop/a> pa href="+code=__iomem" class="sref">__iomemp/a> *pa href="+code=fifo" class="sref">fifop/a> =opa href="+code=mps" class="sref">mpsp/a>->pa href="+code=fifo" class="sref">fifop/a>;.o396p/a>.o397p/a> pspa1 class="comment">/* clear interrupt and wake up the work queue */p/spa14.o398p/a> ifo(pa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txisr" class="sref">txisrp/a>) &.o399p/a> pa href="+code=in_be32" class="sref">in_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=tximr" class="sref">tximrp/a>) &opa href="+code=MPC512x_PSC_FIFO_EMPTY" class="sref">MPC512x_PSC_FIFO_EMPTYp/a>) {.o400p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=txisr" class="sref">txisrp/a>, pa href="+code=MPC512x_PSC_FIFO_EMPTY" class="sref">MPC512x_PSC_FIFO_EMPTYp/a>);.o401p/a> pa href="+code=out_be32" class="sref">out_be32p/a>(&pa href="+code=fifo" class="sref">fifop/a>->pa href="+code=tximr" class="sref">tximrp/a>,o0);.o402p/a> pa href="+code=compleve" class="sref">complevep/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=done" class="sref">donep/a>);.o403p/a> return pa href="+code=IRQ_HANDLED" class="sref">IRQ_HANDLEDp/a>;.o404p/a> }.o405p/a> return pa href="+code=IRQ_NONE" class="sref">IRQ_NONEp/a>;.o406p/a>}.o407p/a>.o408p/a>pspa1 class="comment">/* bus_num is used only for the case dev->platform_data == NULL */p/spa14.o409p/a>static intopa href="+code=mpc512x_psc_spi_do_probe" class="sref">mpc512x_psc_spi_do_probep/a>(structopa href="+code=device" class="sref">devicep/a> *pa href="+code=dev" class="sref">devp/a>,opa href="+code=u32" class="sref">u32p/a> pa href="+code=regaddr" class="sref">regaddrp/a>,.o410p/a> pa href="+code=u32" class="sref">u32p/a> pa href="+code=size" class="sref">siz

,ounsigned intopa href="+code=irq" class="sref">irqp/a>,.o411p/a> pa href="+code=s16" class="sref">s16p/a> pa href="+code=bus_num" class="sref">bus_nump/a>).o412p/a>{.o413p/a> structopa href="+code=fsl_spi_platform_data" class="sref">fsl_spi_platform_datap/a> *pa href="+code=pdata" class="sref">pdatap/a> =opa href="+code=dev" class="sref">devp/a>->pa href="+code=platform_data" class="sref">platform_datap/a>;.o414p/a> structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a>;.o415p/a> structopa href="+code=spi_master" class="sref">spi_masterp/a> *pa href="+code=master" class="sref">masterp/a>;.o416p/a> intopa href="+code=ret" class="sref">retp/a>;.o417p/a> void *pa href="+code=tempp" class="sref">temppp/a>;.o418p/a>.o419p/a> pa href="+code=master" class="sref">masterp/a> =opa href="+code=spi_alloc_master" class="sref">spi_alloc_masterp/a>(pa href="+code=dev" class="sref">devp/a>,osizeof *pa href="+code=mps" class="sref">mpsp/a>);.o420p/a> ifo(pa href="+code=master" class="sref">masterp/a> ==opa href="+code=NULL" class="sref">NULLp/a>).o421p/a> return -pa href="+code=ENOMEM" class="sref">ENOMEMp/a>;.o422p/a>.o423p/a> pa href="+code=dev_set_drvdata" class="sref">dev_set_drvdatap/a>(pa href="+code=dev" class="sref">devp/a>,opa href="+code=master" class="sref">masterp/a>);.o424p/a> pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=master" class="sref">masterp/a>);.o425p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=irq" class="sref">irqp/a> =opa href="+code=irq" class="sref">irqp/a>;.o426p/a>.o427p/a> ifo(pa href="+code=pdata" class="sref">pdatap/a> ==opa href="+code=NULL" class="sref">NULLp/a>) {.o428p/a> pa href="+code=dev_err" class="sref">dev_errp/a>(pa href="+code=dev" class="sref">devp/a>,opspa1 class="string">"probe called without platform data, no "p/spa14.o429p/a> pspa1 class="string">"cs_control function will be called\n"p/spa14);.o430p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=cs_control" class="sref">cs_controlp/a> =opa href="+code=NULL" class="sref">NULLp/a>;.o431p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=sysclk" class="sref">sysclkp/a> =o0;.o432p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=bus_num" class="sref">bus_nump/a> =opa href="+code=bus_num" class="sref">bus_nump/a>;.o433p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=num_chipselect" class="sref">num_chipselectp/a> =o255;.o434p/a> } else {.o435p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=cs_control" class="sref">cs_controlp/a> =opa href="+code=pdata" class="sref">pdatap/a>->pa href="+code=cs_control" class="sref">cs_controlp/a>;.o436p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=sysclk" class="sref">sysclkp/a> =opa href="+code=pdata" class="sref">pdatap/a>->pa href="+code=sysclk" class="sref">sysclkp/a>;.o437p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=bus_num" class="sref">bus_nump/a> =opa href="+code=pdata" class="sref">pdatap/a>->pa href="+code=bus_num" class="sref">bus_nump/a>;.o438p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=num_chipselect" class="sref">num_chipselectp/a> =opa href="+code=pdata" class="sref">pdatap/a>->pa href="+code=max_chipselect" class="sref">max_chipselectp/a>;.o439p/a> }.o440p/a>.o441p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=mode_bits" class="sref">mode_bitsp/a> =opa href="+code=SPI_CPOL" class="sref">SPI_CPOLp/a> | pa href="+code=SPI_CPHA" class="sref">SPI_CPHAp/a> | pa href="+code=SPI_CS_HIGH" class="sref">SPI_CS_HIGHp/a> | pa href="+code=SPI_LSB_FIRST" class="sref">SPI_LSB_FIRSTp/a>;.o442p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=setup" class="sref">setupp/a> =opa href="+code=mpc512x_psc_spi_setup" class="sref">mpc512x_psc_spi_setupp/a>;.o443p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=transfer" class="sref">transferp/a> =opa href="+code=mpc512x_psc_spi_transfer" class="sref">mpc512x_psc_spi_transferp/a>;.o444p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=cleanup" class="sref">cleanupp/a> =opa href="+code=mpc512x_psc_spi_cleanup" class="sref">mpc512x_psc_spi_cleanupp/a>;.o445p/a> pa href="+code=master" class="sref">masterp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=of_node" class="sref">of_nodep/a> =opa href="+code=dev" class="sref">devp/a>->pa href="+code=of_node" class="sref">of_nodep/a>;.o446p/a>.o447p/a> pa href="+code=tempp" class="sref">temppp/a> =opa href="+code=ioremap" class="sref">ioremapp/a>(pa href="+code=regaddr" class="sref">regaddrp/a>, pa href="+code=size" class="sref">siz

);.o448p/a> ifo(!pa href="+code=tempp" class="sref">temppp/a>) {.o449p/a> pa href="+code=dev_err" class="sref">dev_errp/a>(pa href="+code=dev" class="sref">devp/a>,opspa1 class="string">"could not ioremap I/O port range\n"p/spa14);.o450p/a> pa href="+code=ret" class="sref">retp/a> =o-pa href="+code=EFAULT" class="sref">EFAULTp/a>;.o451p/a> gotoopa href="+code=free_master" class="sref">free_masterp/a>;.o452p/a> }.o453p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a> =opa href="+code=tempp" class="sref">temppp/a>;.o454p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=fifo" class="sref">fifop/a> =.o455p/a> (structopa href="+code=mpc512x_psc_fifo" class="sref">mpc512x_psc_fifop/a> *)(pa href="+code=tempp" class="sref">temppp/a> +osizeof(structopa href="+code=mpc52xx_psc" class="sref">mpc52xx_pscp/a>));.o456p/a>.o457p/a> pa href="+code=ret" class="sref">retp/a> =opa href="+code=request_irq" class="sref">request_irqp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=irq" class="sref">irqp/a>,opa href="+code=mpc512x_psc_spi_isr" class="sref">mpc512x_psc_spi_isrp/a>,opa href="+code=IRQF_SHARED" class="sref">IRQF_SHAREDp/a>,.o458p/a> pspa1 class="string">"mpc512x-psc-spi"p/spa14,opa href="+code=mps" class="sref">mpsp/a>);.o459p/a> ifo(pa href="+code=ret" class="sref">retp/a>).o460p/a> gotoopa href="+code=free_master" class="sref">free_masterp/a>;.o461p/a>.o462p/a> pa href="+code=ret" class="sref">retp/a> =opa href="+code=mpc512x_psc_spi_port_config" class="sref">mpc512x_psc_spi_port_configp/a>(pa href="+code=master" class="sref">masterp/a>,opa href="+code=mps" class="sref">mpsp/a>);.o463p/a> ifo(pa href="+code=ret" class="sref">retp/a> < 0).o464p/a> gotoopa href="+code=free_irq" class="sref">free_irqp/a>;.o465p/a>.o466p/a> pa href="+code=spin_lock_init" class="sref">spin_lock_initp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=lock" class="sref">lockp/a>);.o467p/a> pa href="+code=init_complevion" class="sref">init_complevionp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=done" class="sref">donep/a>);.o468p/a> pa href="+code=INIT_WORK" class="sref">INIT_WORKp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=work" class="sref">workp/a>,opa href="+code=mpc512x_psc_spi_work" class="sref">mpc512x_psc_spi_workp/a>);.o469p/a> pa href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEADp/a>(&pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=queue" class="sref">queuep/a>);.o470p/a>.o471p/a> pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=workqueue" class="sref">workqueuep/a> =.o472p/a> pa href="+code=create_singlevhread_workqueue" class="sref">create_singlevhread_workqueuep/a>(pa href="+code=dev_nam<" class="sref">dev_nam

(pa href="+code=master" class="sref">masterp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=parent" class="sref">parentp/a>));.o473p/a> ifo(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=workqueue" class="sref">workqueuep/a> ==opa href="+code=NULL" class="sref">NULLp/a>) {.o474p/a> pa href="+code=ret" class="sref">retp/a> =o-pa href="+code=EBUSY" class="sref">EBUSYp/a>;.o475p/a> gotoopa href="+code=free_irq" class="sref">free_irqp/a>;.o476p/a> }.o477p/a>.o478p/a> pa href="+code=ret" class="sref">retp/a> =opa href="+code=spi_register_master" class="sref">spi_register_masterp/a>(pa href="+code=master" class="sref">masterp/a>);.o479p/a> ifo(pa href="+code=ret" class="sref">retp/a> < 0).o480p/a> gotoopa href="+code=unreg_master" class="sref">unreg_masterp/a>;.o481p/a>.o482p/a> return pa href="+code=ret" class="sref">retp/a>;.o483p/a>.o484p/a>pa href="+code=unreg_master" class="sref">unreg_masterp/a>:.o485p/a> pa href="+code=destroy_workqueue" class="sref">destroy_workqueuep/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=workqueue" class="sref">workqueuep/a>);.o486p/a>pa href="+code=free_irq" class="sref">free_irqp/a>:.o487p/a> pa href="+code=free_irq" class="sref">free_irqp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=irq" class="sref">irqp/a>,opa href="+code=mps" class="sref">mpsp/a>);.o488p/a>pa href="+code=free_master" class="sref">free_masterp/a>:.o489p/a> ifo(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>).o490p/a> pa href="+code=iounmap" class="sref">iounmapp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>);.o491p/a> pa href="+code=spi_master_put" class="sref">spi_master_putp/a>(pa href="+code=master" class="sref">masterp/a>);.o492p/a>.o493p/a> return pa href="+code=ret" class="sref">retp/a>;.o494p/a>}.o495p/a>.o496p/a>static intopa href="+code=mpc512x_psc_spi_do_remove" class="sref">mpc512x_psc_spi_do_removep/a>(structopa href="+code=device" class="sref">devicep/a> *pa href="+code=dev" class="sref">devp/a>).o497p/a>{.o498p/a> structopa href="+code=spi_master" class="sref">spi_masterp/a> *pa href="+code=master" class="sref">masterp/a> =opa href="+code=spi_master_get" class="sref">spi_master_getp/a>(pa href="+code=dev_get_drvdata" class="sref">dev_get_drvdatap/a>(pa href="+code=dev" class="sref">devp/a>));.o499p/a> structopa href="+code=mpc512x_psc_spi" class="sref">mpc512x_psc_spip/a> *pa href="+code=mps" class="sref">mpsp/a> =opa href="+code=spi_master_get_devdata" class="sref">spi_master_get_devdatap/a>(pa href="+code=master" class="sref">masterp/a>);.o500p/a>.o501p/a> pa href="+code=flush_workqueue" class="sref">flush_workqueuep/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=workqueue" class="sref">workqueuep/a>);.o502p/a> pa href="+code=destroy_workqueue" class="sref">destroy_workqueuep/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=workqueue" class="sref">workqueuep/a>);.o503p/a> pa href="+code=spi_unregister_master" class="sref">spi_unregister_masterp/a>(pa href="+code=master" class="sref">masterp/a>);.o504p/a> pa href="+code=free_irq" class="sref">free_irqp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=irq" class="sref">irqp/a>,opa href="+code=mps" class="sref">mpsp/a>);.o505p/a> ifo(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>).o506p/a> pa href="+code=iounmap" class="sref">iounmapp/a>(pa href="+code=mps" class="sref">mpsp/a>->pa href="+code=psc" class="sref">pscp/a>);.o507p/a> pa href="+code=spi_master_put" class="sref">spi_master_putp/a>(pa href="+code=master" class="sref">masterp/a>);.o508p/a>.o509p/a> return 0;.o510p/a>}.o511p/a>.o512p/a>static intopa href="+code=mpc512x_psc_spi_of_probe" class="sref">mpc512x_psc_spi_of_probep/a>(structopa href="+code=platform_device" class="sref">platform_devicep/a> *pa href="+code=op" class="sref">opp/a>).o513p/a>{.o514p/a> constopa href="+code=u32" class="sref">u32p/a> *pa href="+code=regaddr_p" class="sref">regaddr_pp/a>;.o515p/a> pa href="+code=u64" class="sref">u64p/a> pa href="+code=regaddr64" class="sref">regaddr64p/a>,opa href="+code=size64" class="sref">size64p/a>;.o516p/a> pa href="+code=s16" class="sref">s16p/a> pa href="+code=id" class="sref">idp/a> =o-1;.o517p/a>.o518p/a> pa href="+code=regaddr_p" class="sref">regaddr_pp/a> =opa href="+code=of_get_address" class="sref">of_get_addressp/a>(pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=of_node" class="sref">of_nodep/a>, 0, &pa href="+code=size64" class="sref">size64p/a>,opa href="+code=NULL" class="sref">NULLp/a>);.o519p/a> ifo(!pa href="+code=regaddr_p" class="sref">regaddr_pp/a>) {.o520p/a> pa href="+code=dev_err" class="sref">dev_errp/a>(&pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>,opspa1 class="string">"Invalid PSC address\n"p/spa14);.o521p/a> return -pa href="+code=EINVAL" class="sref">EINVALp/a>;.o522p/a> }.o523p/a> pa href="+code=regaddr64" class="sref">regaddr64p/a> =opa href="+code=of_translate_address" class="sref">of_translate_addressp/a>(pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=of_node" class="sref">of_nodep/a>, pa href="+code=regaddr_p" class="sref">regaddr_pp/a>);.o524p/a>.o525p/a> pspa1 class="comment">/* get PSC id (0..11, used by port_config) */p/spa14.o526p/a> pa href="+code=id" class="sref">idp/a> =opa href="+code=of_alias_get_id" class="sref">of_alias_get_idp/a>(pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=of_node" class="sref">of_nodep/a>, pspa1 class="string">"spi"p/spa14);.o527p/a> ifo(pa href="+code=id" class="sref">idp/a> < 0) {.o528p/a> pa href="+code=dev_err" class="sref">dev_errp/a>(&pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>,opspa1 class="string">"no alias id for %s\n"p/spa14,.o529p/a> pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=of_node" class="sref">of_nodep/a>->pa href="+code=full_nam<" class="sref">full_nam

);.o530p/a> return pa href="+code=id" class="sref">idp/a>;.o531p/a> }.o532p/a>.o533p/a> return pa href="+code=mpc512x_psc_spi_do_probe" class="sref">mpc512x_psc_spi_do_probep/a>(&pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>,o(pa href="+code=u32" class="sref">u32p/a>) pa href="+code=regaddr64" class="sref">regaddr64p/a>,o(pa href="+code=u32" class="sref">u32p/a>) pa href="+code=size64" class="sref">size64p/a>,.o534p/a> pa href="+code=irq_of_parse_and_map" class="sref">irq_of_parse_and_mapp/a>(pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>.pa href="+code=of_node" class="sref">of_nodep/a>, 0), pa href="+code=id" class="sref">idp/a>);.o535p/a>}.o536p/a>.o537p/a>static intopa href="+code=mpc512x_psc_spi_of_remove" class="sref">mpc512x_psc_spi_of_removep/a>(structopa href="+code=platform_device" class="sref">platform_devicep/a> *pa href="+code=op" class="sref">opp/a>).o538p/a>{.o539p/a> return pa href="+code=mpc512x_psc_spi_do_remove" class="sref">mpc512x_psc_spi_do_removep/a>(&pa href="+code=op" class="sref">opp/a>->pa href="+code=dev" class="sref">devp/a>);.o540p/a>}.o541p/a>.o542p/a>static structopa href="+code=of_device_id" class="sref">of_device_idp/a> pa href="+code=mpc512x_psc_spi_of_match" class="sref">mpc512x_psc_spi_of_matchp/a>[] =o{.o543p/a> { .pa href="+code=compatible" class="sref">compatiblep/a> =opspa1 class="string">"fsl,mpc5121-psc-spi"p/spa14,o},.o544p/a> {},.o545p/a>};.o546p/a>.o547p/a>pa href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLEp/a>(pa href="+code=of" class="sref">ofp/a>,opa href="+code=mpc512x_psc_spi_of_match" class="sref">mpc512x_psc_spi_of_matchp/a>);.o548p/a>.o549p/a>static structopa href="+code=platform_driver" class="sref">platform_driverp/a> pa href="+code=mpc512x_psc_spi_of_driver" class="sref">mpc512x_psc_spi_of_driverp/a> =o{.o550p/a> .pa href="+code=probe" class="sref">probep/a> =opa href="+code=mpc512x_psc_spi_of_probe" class="sref">mpc512x_psc_spi_of_probep/a>,.o551p/a> .pa href="+code=remove" class="sref">removep/a> =opa href="+code=mpc512x_psc_spi_of_remove" class="sref">mpc512x_psc_spi_of_removep/a>,.o552p/a> .pa href="+code=driver" class="sref">driverp/a> =o{.o553p/a> .pa href="+code=nam<" class="sref">nam

=opspa1 class="string">"mpc512x-psc-spi"p/spa14,.o554p/a> .pa href="+code=owner" class="sref">ownerp/a> =opa href="+code=THIS_MODULE" class="sref">THIS_MODULEp/a>,.o555p/a> .pa href="+code=of_match_table" class="sref">of_match_tablep/a> =opa href="+code=mpc512x_psc_spi_of_match" class="sref">mpc512x_psc_spi_of_matchp/a>,.o556p/a> },.o557p/a>};.o558p/a>pa href="+code=module_platform_driver" class="sref">module_platform_driverp/a>(pa href="+code=mpc512x_psc_spi_of_driver" class="sref">mpc512x_psc_spi_of_driverp/a>);.o559p/a>.o560p/a>pa href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHORp/a>(pspa1 class="string">"John Rigby"p/spa14);.o561p/a>pa href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTIONp/a>(pspa1 class="string">"MPC512x PSC SPI Driver"p/spa14);.o562p/a>pa href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSEp/a>(pspa1 class="string">"GPL"p/spa14);.o563p/a>

lxr.linux.no kindly hosted by Redpill Linpro ASp/a>,oprovider of Linux consulting and operavions services since 1995.