linux/drivers/ata/ahci_platform.c
<<
.4./spaue= .4./forme= .4.a .4 href="../linux+v3.9.5/drivers/ata/ahci_platform.c"> .4.img src="../.static/gfx/right.png" alt=">>"> ./spaue= .spau class="lxr_search"> .4.input typv3.hidden" namv3.navtarget" > v3."> .4.input typv3.text" namv3.search" id3.search"> .4.butt typv3.submit">Search .4Prefs= .4./a> ./spaue= .4 4./dive= .4 4.form acvalu="ajax+*" method="post" onsubmit="return false;"> .input typv3.hidden" namv3.ajax_lookup" id3.ajax_lookup" > v3."> .4 4./forme= .4 4.div class="headingbott m">= .div id3.file_contents"e
4 41./a>.spau class="comment">/*./spaue=4 42./a>.spau class="comment"> * AHCI SATA platform driver./spaue=4 43./a>.spau class="comment"> *./spaue=4 44./a>.spau class="comment"> * Copyright 2004-2005  Red Hat, Inc../spaue=4 45./a>.spau class="comment"> *   Jeff Garzik <jgarzik@pobox.com>./spaue=4 46./a>.spau class="comment"> * Copyright 2010  MontaVista Software, LLC../spaue=4 47./a>.spau class="comment"> *   Ant	  Vorontsov <avorontsov@ru.mvista.com>./spaue=4 48./a>.spau class="comment"> *./spaue=4 49./a>.spau class="comment"> * This program is free software; you cau redistribute it and/or modify./spaue=4 ptioa>.spau class="comment"> * it under the terms of the GNU General Public License as published by./spaue=4 11./a>.spau class="comment"> * the Free Software Foundavalu; either vers
	  2, or (at your n valu)./spaue=4 12./a>.spau class="comment"> * any later vers
	 ../spaue=4 13./a>.spau class="comment"> */./spaue=4 14./a>=4 15./a>#include <linux/clk.h./a>>=4 16./a>#include <linux/kernel.h./a>>=4 17./a>#include <linux/gfp.h./a>>=4 18./a>#include <linux/module.h./a>>=4 19./a>#include <linux/pm.h./a>>=4 20./a>#include <linux/init.h./a>>=4 21./a>#include <linux/interrupt.h./a>>=4 22./a>#include <linux/device.h./a>>=4 23./a>#include <linux/platform_device.h./a>>=4 24./a>#include <linux/libata.h./a>>=4 25./a>#include <linux/ahci_platform.h./a>>=4 26./a>#include "ahci.h./a>"=4 27./a>=4 28./a>static void4.a href="+code=ahci_host_stop" class="sref">ahci_host_stop./a>(struct4.a href="+code=ata_host" class="sref">ata_host./a> *.a href="+code=host" class="sref">host./a>);=4 29./a>=4 30./a>enum4.a href="+code=ahci_typv" class="sref">ahci_typv./a> {=4 31./a>        .a href="+code=AHCI" class="sref">AHCI./a>,           .spau class="comment">/* standard platform ahci */./spaue=4 32./a>        .a href="+code=IMX53_AHCI" class="sref">IMX53_AHCI./a>,     .spau class="comment">/* ahci 	  i.mx53 */./spaue=4 33./a>        .a href="+code=STRICT_AHCI" class="sref">STRICT_AHCI./a>,    .spau class="comment">/* delayed DMA engine start */./spaue=4 34./a>};=4 35./a>=4 36./a>static struct4.a href="+code=platform_device_id" class="sref">platform_device_id./a> .a href="+code=ahci_devtypv" class="sref">ahci_devtypv./a>[] = {=4 37./a>        {=4 38./a>                ..a href="+code=namv" class="sref">namv./a> = .spau class="string">"ahci"4 39./a>                ..a href="+code=driver_data" class="sref">driver_data./a> = .a href="+code=AHCI" class="sref">AHCI./a>,=4 40./a>        }, {=4 41./a>                ..a href="+code=namv" class="sref">namv./a> = .spau class="string">"imx53-ahci"4 42./a>                ..a href="+code=driver_data" class="sref">driver_data./a> = .a href="+code=IMX53_AHCI" class="sref">IMX53_AHCI./a>,=4 43./a>        }, {=4 44./a>                ..a href="+code=namv" class="sref">namv./a> = .spau class="string">"strict-ahci"4 45./a>                ..a href="+code=driver_data" class="sref">driver_data./a> = .a href="+code=STRICT_AHCI" class="sref">STRICT_AHCI./a>,=4 46./a>        }, {=4 47./a>                .spau class="comment">/* sentinel */./spaue=4 48./a>        }=4 49./a>};=4 5tioa>.a href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLE./a>(.a href="+code=platform" class="sref">platform./a>, .a href="+code=ahci_devtypv" class="sref">ahci_devtypv./a>);=4 51./a>=4 52./a>static struct4.a href="+code=ata_port_operavalus" class="sref">ata_port_operavalus./a> .a href="+code=ahci_platform_ops" class="sref">ahci_platform_ops./a> = {=4 53./a>        ..a href="+code=inherits" class="sref">inherits./a>       = &.a href="+code=ahci_ops" class="sref">ahci_ops./a>,=4 54./a>        ..a href="+code=host_stop" class="sref">host_stop./a>      = .a href="+code=ahci_host_stop" class="sref">ahci_host_stop./a>,=4 55./a>};=4 56./a>=4 57./a>static struct4.a href="+code=ata_port_operavalus" class="sref">ata_port_operavalus./a> .a href="+code=ahci_platform_retry_srst_ops" class="sref">ahci_platform_retry_srst_ops./a> = {=4 58./a>        ..a href="+code=inherits" class="sref">inherits./a>       = &.a href="+code=ahci_pmp_retry_srst_ops" class="sref">ahci_pmp_retry_srst_ops./a>,=4 59./a>        ..a href="+code=host_stop" class="sref">host_stop./a>      = .a href="+code=ahci_host_stop" class="sref">ahci_host_stop./a>,=4 60./a>};=4 61./a>=4 62./a>static clust struct4.a href="+code=ata_port_info" class="sref">ata_port_info./a> .a href="+code=ahci_port_info" class="sref">ahci_port_info./a>[] = {=4 63./a>        .spau class="comment">/* by features */./spaue=4 64./a>        [.a href="+code=AHCI" class="sref">AHCI./a>] = {=4 65./a>                ..a href="+code=flags" class="sref">flags./a>          = .a href="+code=AHCI_FLAG_COMMON" class="sref">AHCI_FLAG_COMMON./a>,=4 66./a>                ..a href="+code=pio_mask" class="sref">pio_mask./a>       = .a href="+code=ATA_PIO4" class="sref">ATA_PIO4./a>,=4 67./a>                ..a href="+code=udma_mask" class="sref">udma_mask./a>      = .a href="+code=ATA_UDMA6" class="sref">ATA_UDMA6./a>,=4 68./a>                ..a href="+code=port_ops" class="sref">port_ops./a>       = &.a href="+code=ahci_platform_ops" class="sref">ahci_platform_ops./a>,=4 69./a>        },=4 70./a>        [.a href="+code=IMX53_AHCI" class="sref">IMX53_AHCI./a>] = {=4 71./a>                ..a href="+code=flags" class="sref">flags./a>          = .a href="+code=AHCI_FLAG_COMMON" class="sref">AHCI_FLAG_COMMON./a>,=4 72./a>                ..a href="+code=pio_mask" class="sref">pio_mask./a>       = .a href="+code=ATA_PIO4" class="sref">ATA_PIO4./a>,=4 73./a>                ..a href="+code=udma_mask" class="sref">udma_mask./a>      = .a href="+code=ATA_UDMA6" class="sref">ATA_UDMA6./a>,=4 74./a>                ..a href="+code=port_ops" class="sref">port_ops./a>       = &.a href="+code=ahci_platform_retry_srst_ops" class="sref">ahci_platform_retry_srst_ops./a>,=4 75./a>        },=4 76./a>        [.a href="+code=STRICT_AHCI" class="sref">STRICT_AHCI./a>] = {=4 77./a>                .a href="+code=AHCI_HFLAGS" class="sref">AHCI_HFLAGS./a>     (.a href="+code=AHCI_HFLAG_DELAY_ENGINE" class="sref">AHCI_HFLAG_DELAY_ENGINE./a>),=4 78./a>                ..a href="+code=flags" class="sref">flags./a>          = .a href="+code=AHCI_FLAG_COMMON" class="sref">AHCI_FLAG_COMMON./a>,=4 79./a>                ..a href="+code=pio_mask" class="sref">pio_mask./a>       = .a href="+code=ATA_PIO4" class="sref">ATA_PIO4./a>,=4 80./a>                ..a href="+code=udma_mask" class="sref">udma_mask./a>      = .a href="+code=ATA_UDMA6" class="sref">ATA_UDMA6./a>,=4 81./a>                ..a href="+code=port_ops" class="sref">port_ops./a>       = &.a href="+code=ahci_platform_ops" class="sref">ahci_platform_ops./a>,=4 82./a>        },=4 83./a>};=4 84./a>=4 85./a>static struct4.a href="+code=scsi_host_templatv" class="sref">scsi_host_templatv./a> .a href="+code=ahci_platform_sht" class="sref">ahci_platform_sht./a> = {=4 86./a>        .a href="+code=AHCI_SHT" class="sref">AHCI_SHT./a>(.spau class="string">"ahci_platform"4 87./a>};=4 88./a>=4 89./a>static int4.a href="+code=ahci_probv" class="sref">ahci_probv./a>(struct4.a href="+code=platform_device" class="sref">platform_device./a> *.a href="+code=pdev" class="sref">pdev./a>)=4 90./a>{=4 91./a>        struct4.a href="+code=device" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a> = &.a href="+code=pdev" class="sref">pdev./a>->.a href="+code=dev" class="sref">dev./a>;=4 92./a>        struct4.a href="+code=ahci_platform_data" class="sref">ahci_platform_data./a> *.a href="+code=pdata" class="sref">pdata./a> = .a href="+code=dev_get_platdata" class="sref">dev_get_platdata./a>(.a href="+code=dev" class="sref">dev./a>);=4 93./a>        clust struct4.a href="+code=platform_device_id" class="sref">platform_device_id./a> *.a href="+code=id" class="sref">id./a> = .a href="+code=platform_get_device_id" class="sref">platform_get_device_id./a>(.a href="+code=pdev" class="sref">pdev./a>);=4 94./a>        struct4.a href="+code=ata_port_info" class="sref">ata_port_info./a> .a href="+code=pi" class="sref">pi./a> = .a href="+code=ahci_port_info" class="sref">ahci_port_info./a>[.a href="+code=id" class="sref">id./a> ? .a href="+code=id" class="sref">id./a>->.a href="+code=driver_data" class="sref">driver_data./a> : 0];=4 95./a>        clust struct4.a href="+code=ata_port_info" class="sref">ata_port_info./a> *.a href="+code=ppi" class="sref">ppi./a>[] = { &.a href="+code=pi" class="sref">pi./a>, .a href="+code=NULL" class="sref">NULL./a> };=4 96./a>        struct4.a href="+code=ahci_host_priv" class="sref">ahci_host_priv./a> *.a href="+code=hpriv" class="sref">hpriv./a>;=4 97./a>        struct4.a href="+code=ata_host" class="sref">ata_host./a> *.a href="+code=host" class="sref">host./a>;=4 98./a>        struct4.a href="+code=resource" class="sref">resource./a> *.a href="+code=mem" class="sref">mem./a>;=4 99./a>        int4.a href="+code=irq" class="sref">irq./a>;=4100./a>        int4.a href="+code=n_ports" class="sref">n_ports./a>;=4101./a>        int4.a href="+code=i" class="sref">i./a>;=4102./a>        int4.a href="+code=rc" class="sref">rc./a>;=4103./a>=4104./a>        .a href="+code=mem" class="sref">mem./a> = .a href="+code=platform_get_resource" class="sref">platform_get_resource./a>(.a href="+code=pdev" class="sref">pdev./a>, .a href="+code=IORESOURCE_MEM" class="sref">IORESOURCE_MEM./a>, 0);=4105./a>        if (!.a href="+code=mem" class="sref">mem./a>) {=4106./a>                .a href="+code=dev_err" class="sref">dev_err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"no mmio space\n"4107./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>;=4108./a>        }=4109./a>=4110./a>        .a href="+code=irq" class="sref">irq./a> = .a href="+code=platform_get_irq" class="sref">platform_get_irq./a>(.a href="+code=pdev" class="sref">pdev./a>, 0);=4111./a>        if (.a href="+code=irq" class="sref">irq./a> <= 0) {=4112./a>                .a href="+code=dev_err" class="sref">dev_err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"no irq\n"4113./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>;=4114./a>        }=4115./a>=4116./a>        if (.a href="+code=pdata" class="sref">pdata./a> && .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=ata_port_info" class="sref">ata_port_info./a>)=4117./a>                .a href="+code=pi" class="sref">pi./a> = *.a href="+code=pdata" class="sref">pdata./a>->.a href="+code=ata_port_info" class="sref">ata_port_info./a>;=4118./a>=4119./a>        .a href="+code=hpriv" class="sref">hpriv./a> = .a href="+code=devm_kzalloc" class="sref">devm_kzalloc./a>(.a href="+code=dev" class="sref">dev./a>, sizeof(*.a href="+code=hpriv" class="sref">hpriv./a>), .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>);=4120./a>        if (!.a href="+code=hpriv" class="sref">hpriv./a>) {=4121./a>                .a href="+code=dev_err" class="sref">dev_err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"can't alloc ahci_host_priv\n"4122./a>                return -.a href="+code=ENOMEM" class="sref">ENOMEM./a>;=4123./a>        }=4124./a>=4125./a>        .a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=flags" class="sref">flags./a> |= (unsigned long).a href="+code=pi" class="sref">pi./a>..a href="+code=private_data" class="sref">private_data./a>;=4126./a>=4127./a>        .a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=mmio" class="sref">mmio./a> = .a href="+code=devm_ioremap" class="sref">devm_ioremap./a>(.a href="+code=dev" class="sref">dev./a>, .a href="+code=mem" class="sref">mem./a>->.a href="+code=start" class="sref">start./a>, .a href="+code=resource_size" class="sref">resource_size./a>(.a href="+code=mem" class="sref">mem./a>));=4128./a>        if (!.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=mmio" class="sref">mmio./a>) {=4129./a>                .a href="+code=dev_err" class="sref">dev_err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"can't map %pR\n"mem./a>);=4130./a>                return -.a href="+code=ENOMEM" class="sref">ENOMEM./a>;=4131./a>        }=4132./a>=4133./a>        .a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a> = .a href="+code=clk_get" class="sref">clk_get./a>(.a href="+code=dev" class="sref">dev./a>, .a href="+code=NULL" class="sref">NULL./a>);=4134./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4135./a>                .a href="+code=dev_err" class="sref">dev_err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"can't get clock\n"4136./a>        } else {=4137./a>                .a href="+code=rc" class="sref">rc./a> = .a href="+code=clk_prepare_enable" class="sref">clk_prepare_enable./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>);=4138./a>                if (.a href="+code=rc" class="sref">rc./a>) {=4139./a>                        .a href="+code=dev_err" class="sref">dev_err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"clock prepare enable failed"4140./a>                        goto .a href="+code=free_clk" class="sref">free_clk./a>;=4141./a>                }=4142./a>        }=4143./a>=4144./a>        .spau class="comment">/*./spaue=4145./a>.spau class="comment">         * Some platforms might need to prepare for mmio reg
	  access,./spaue=4146./a>.spau class="comment">         * which could be done in the following init call. So, the mmio./spaue=4147./a>.spau class="comment">         * reg
	  shouldn't be accessed before init (if provided) has./spaue=4148./a>.spau class="comment">         * returned successfully../spaue=4149./a>.spau class="comment">         */./spaue=4150./a>        if (.a href="+code=pdata" class="sref">pdata./a> && .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=init" class="sref">init./a>) {=4151./a>                .a href="+code=rc" class="sref">rc./a> = .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=init" class="sref">init./a>(.a href="+code=dev" class="sref">dev./a>, .a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=mmio" class="sref">mmio./a>);=4152./a>                if (.a href="+code=rc" class="sref">rc./a>)=4153./a>                        goto .a href="+code=disable_unprepare_clk" class="sref">disable_unprepare_clk./a>;=4154./a>        }=4155./a>=4156./a>        .a href="+code=ahci_save_initial_config" class="sref">ahci_save_initial_config./a>(.a href="+code=dev" class="sref">dev./a>, .a href="+code=hpriv" class="sref">hpriv./a>,=4157./a>                .a href="+code=pdata" class="sref">pdata./a> ? .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=force_port_map" class="sref">force_port_map./a> : 0,=4158./a>                .a href="+code=pdata" class="sref">pdata./a> ? .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=mask_port_map" class="sref">mask_port_map./a>  : 0);=4159./a>=4160./a>        .spau class="comment">/* prepare host */./spaue=4161./a>        if (.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=cap" class="sref">cap./a> & .a href="+code=HOST_CAP_NCQ" class="sref">HOST_CAP_NCQ./a>)=4162./a>                .a href="+code=pi" class="sref">pi./a>..a href="+code=flags" class="sref">flags./a> |= .a href="+code=ATA_FLAG_NCQ" class="sref">ATA_FLAG_NCQ./a>;=4163./a>=4164./a>        if (.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=cap" class="sref">cap./a> & .a href="+code=HOST_CAP_PMP" class="sref">HOST_CAP_PMP./a>)=4165./a>                .a href="+code=pi" class="sref">pi./a>..a href="+code=flags" class="sref">flags./a> |= .a href="+code=ATA_FLAG_PMP" class="sref">ATA_FLAG_PMP./a>;=4166./a>=4167./a>        .a href="+code=ahci_set_em_messages" class="sref">ahci_set_em_messages./a>(.a href="+code=hpriv" class="sref">hpriv./a>, &.a href="+code=pi" class="sref">pi./a>);=4168./a>=4169./a>        .spau class="comment">/* CAP.NP sometimes indicate the index of the last enabled./spaue=417tioa>.spau class="comment">         * port, at other times, that of the last possible port, so./spaue=4171./a>.spau class="comment">         * determining the maximum port number requires looking at./spaue=4172./a>.spau class="comment">         * both CAP.NP and port_map../spaue=4173./a>.spau class="comment">         */./spaue=4174./a>        .a href="+code=n_ports" class="sref">n_ports./a> = .a href="+code=max" class="sref">max./a>(.a href="+code=ahci_nr_ports" class="sref">ahci_nr_ports./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=cap" class="sref">cap./a>), .a href="+code=fls" class="sref">fls./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=port_map" class="sref">port_map./a>));=4175./a>=4176./a>        .a href="+code=host" class="sref">host./a> = .a href="+code=ata_host_alloc_pinfo" class="sref">ata_host_alloc_pinfo./a>(.a href="+code=dev" class="sref">dev./a>, .a href="+code=ppi" class="sref">ppi./a>, .a href="+code=n_ports" class="sref">n_ports./a>);=4177./a>        if (!.a href="+code=host" class="sref">host./a>) {=4178./a>                .a href="+code=rc" class="sref">rc./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>;=4179./a>                goto .a href="+code=pdata_exit" class="sref">pdata_exit./a>;=4180./a>        }=4181./a>=4182./a>        .a href="+code=host" class="sref">host./a>->.a href="+code=private_data" class="sref">private_data./a> = .a href="+code=hpriv" class="sref">hpriv./a>;=4183./a>=4184./a>        if (!(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=cap" class="sref">cap./a> & .a href="+code=HOST_CAP_SSS" class="sref">HOST_CAP_SSS./a>) || .a href="+code=ahci_ignore_sss" class="sref">ahci_ignore_sss./a>)=4185./a>                .a href="+code=host" class="sref">host./a>->.a href="+code=flags" class="sref">flags./a> |= .a href="+code=ATA_HOST_PARALLEL_SCAN" class="sref">ATA_HOST_PARALLEL_SCAN./a>;=4186./a>        else=4187./a>                .a href="+code=printk" class="sref">printk./a>(.a href="+code=KERN_INFO" class="sref">KERN_INFO./a> .spau class="string">"ahci: SSS flag set, parallel bus scau disabled\n"4188./a>=4189./a>        if (.a href="+code=pi" class="sref">pi./a>..a href="+code=flags" class="sref">flags./a> & .a href="+code=ATA_FLAG_EM" class="sref">ATA_FLAG_EM./a>)=4190./a>                .a href="+code=ahci_reset_em" class="sref">ahci_reset_em./a>(.a href="+code=host" class="sref">host./a>);=4191./a>=4192./a>        for (.a href="+code=i" class="sref">i./a> = 0; .a href="+code=i" class="sref">i./a> < .a href="+code=host" class="sref">host./a>->.a href="+code=n_ports" class="sref">n_ports./a>; .a href="+code=i" class="sref">i./a>++) {=4193./a>                struct4.a href="+code=ata_port" class="sref">ata_port./a> *.a href="+code=ap" class="sref">ap./a> = .a href="+code=host" class="sref">host./a>->.a href="+code=ports" class="sref">ports./a>[.a href="+code=i" class="sref">i./a>];=4194./a>=4195./a>                .a href="+code=ata_port_desc" class="sref">ata_port_desc./a>(.a href="+code=ap" class="sref">ap./a>, .spau class="string">"mmio %pR"mem./a>);=4196./a>                .a href="+code=ata_port_desc" class="sref">ata_port_desc./a>(.a href="+code=ap" class="sref">ap./a>, .spau class="string">"port 0x%x"ap./a>->.a href="+code=port_no" class="sref">port_no./a> * 0x80);=4197./a>=4198./a>                .spau class="comment">/* set enclosure management message typv */./spaue=4199./a>                if (.a href="+code=ap" class="sref">ap./a>->.a href="+code=flags" class="sref">flags./a> & .a href="+code=ATA_FLAG_EM" class="sref">ATA_FLAG_EM./a>)=4200./a>                        .a href="+code=ap" class="sref">ap./a>->.a href="+code=em_message_typv" class="sref">em_message_typv./a> = .a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=em_msg_typv" class="sref">em_msg_typv./a>;=4201./a>=4202./a>                .spau class="comment">/* disabled/not-implemented port */./spaue=4203./a>                if (!(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=port_map" class="sref">port_map./a> & (1 << .a href="+code=i" class="sref">i./a>)))=4204./a>                        .a href="+code=ap" class="sref">ap./a>->.a href="+code=ops" class="sref">ops./a> = &.a href="+code=ata_dummy_port_ops" class="sref">ata_dummy_port_ops./a>;=4205./a>        }=4206./a>=4207./a>        .a href="+code=rc" class="sref">rc./a> = .a href="+code=ahci_reset_controller" class="sref">ahci_reset_controller./a>(.a href="+code=host" class="sref">host./a>);=4208./a>        if (.a href="+code=rc" class="sref">rc./a>)=4209./a>                goto .a href="+code=pdata_exit" class="sref">pdata_exit./a>;=4210./a>=4211./a>        .a href="+code=ahci_init_controller" class="sref">ahci_init_controller./a>(.a href="+code=host" class="sref">host./a>);=4212./a>        .a href="+code=ahci_print_info" class="sref">ahci_print_info./a>(.a href="+code=host" class="sref">host./a>, .spau class="string">"platform"4213./a>=4214./a>        .a href="+code=rc" class="sref">rc./a> = .a href="+code=ata_host_activate" class="sref">ata_host_activate./a>(.a href="+code=host" class="sref">host./a>, .a href="+code=irq" class="sref">irq./a>, .a href="+code=ahci_interrupt" class="sref">ahci_interruptst_activate" class="s_RQkre_sss./a>)=4115./a>=ahci_platform_sht./a> = {=4116./a>        if (.2 href2"+code=pdata" class="sref">pdata.a href="drivers/ata/ahci_platform.c#L209" id3.L209" class="line" namv3.L127">4117./a>             2  .a 2ref="+code=pi" class="exit" class="sref">pdata_exit./a>;=4118./a>=4119./a>        .a hr2f="+c2de=hpriv" clasMEM" cl0i_platform.c#L210" id3.L210" class="line" namv3.L120">4120./a>        if (!2a hre22_DEVICE_TABLE" classdata_exit./a>;=4121./a>             2  .a 22+code=hpriv" class="sref">hpriv./a> && .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=init" class="sref">init./axit./a>;=4122./a>             2  ret2rn -.a href="+code=ENOs="sref">pdata./a>->.a href="+code=init" class="sref">init./axit./a>;=dev./a>);=4123./a>        }=dev./a>);s="sref">disable_unprepare_clk./a>;=4124./a>=)=hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4125./a>        .a hr2f="+c22ef="+code=ata_port_desc" class="srefhref=hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4126./a>=flags./_clk./a>;=4127./a>        .a hr2f="+c22"+code=host" class="sref">host./aa./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4128./a>        if (!2a hre22ef="+code=rc" class="sref">rc./a> = href=u>(.a href="+code=dev=u> class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4129./a>             2  .a 22e=hpriv" clasMEM" cls="sref">pdata.a href="drivers/ata/ahci_platform.c#L93" id3.L93" class="line" 2 namv3.L120">4130./a>             2  ret2rn -.ai_platform.c#L206" id3.L206" class="line" namv3.L121">4131./a>        }=4132./a>=ahci_hosto;.a href="+code=o">ahci_hosto; clashost" class="sref">ata_host./a> *.a href="+code=host" class="sref">host./a>;=4133./a>        .a hr2f="+c2de=hpri_platform.c#L193" id3.L193" class="line2 namv3.L124">4134./a>        if (.2 href2"+code=IS_ERR"ce" class="sref">device./a> *.a href="+code=dev" class="sref">dev./a> = &.a href="+code=pdev" ="sref">host./a>->.a href="+code=ports" class="sref">ports.=4135./a>             2  .a 2ref="+code=dev_platform_data" class="sref">ahci_platform_data./a> *.a href="+code=pdata" class="sref">pdata./a> = .a href="+code=dev_get_platdata" class="sref">dev_get_platdata./a>(.a href="+code=dev" class="sref">dev./a>);=4136./a>        } els2 {=ahci_host_priv./a> *.a href="+code=hpriv" class="sref">hpriv./a>;=host./a>->.a href="+code=ports" class="sref">ports./private_data./a> = .a href="+code=hpriv" ci_platform.c#L93" id3.L92" class="line" 2 namv3.L127">4137./a>             2  .a 23/ahci_platform.c#L198" id3.L198" class="line2 namv3.L128">4138./a>             2  if 23+code=rc" class="sref">rc./a>)= && .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=init" class="sref">init./axit./a>;=4139./a>             2     2    .a href="+code=devs="sref">pdata./a>->.a href="+code=init" class="sref">init./axit./a>;=dev./a>);=4140./a>             2     24/ahci_platform.c#L211" id3.L211" class="line" namv3.L121">4141./a>             2  }=<24+code=hpriv" class="sref">host./aa./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4142./a>        }=pdata.href=hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4143./a>=rc./a> = href=u>(.a href="+code=dev=u> class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4144./a>        .spau2class2"comment">/*./i_platform.c#L206" id3.L206" class="line" namv3.L125">4145./a>.spau class="2ommen2">    i_platform.c#L206" id3.L206" class="line" namv3.L206">4146./a>.spau class="2ommen24/ahci_platform.c#L207" id3.L207" class="line" namv3.L127">4147./a>.spau class="2ommen2">    #ifdefvsref">rc./a> = CONFIs/at_SLEEMP./a>;=4148./a>.spau class="2ommen2">    ahci_probv" class="sref">ahci_psuspen;.a href="+code=hci_psuspen; clashost" class="sref">atae./a> *.a href="+code=dev" class="sref">dev./a> = &.a href="+code=pdei_platform.c#L209" id3.L209" class="line" namv3.L129">4149./a>.spau class="2ommen2">    i_platform.c#L193" id3.L193" class="line2 namv3.L120">4150./a>        if (.2 href2"+code=pdata" _platform_data" class="sref">ahci_platform_data./a> *.a href="+code=pdata" class="sref">pdata./a> = .a href="+code=dev_get_platdata" class="sref">dev_get_platdata./a>(.a href="+code=dev" class="sref">dev./a>);=4151./a>             2  .a 2ref="+code=rc"host" class="sref">ata_host./a> *.a href="+code=host" class="sref">host./a>;=devdrv_platdata./a>(.a href="+coddrv_plalass="sref">dev./a>);=4152./a>             2  if 25f="+code=ahci_platform_data" class="srefci_host_priv./a> *.a href="+code=hpriv" class="sref">hpriv./a>;=host./a>->.a href="+code=ports" class="sref">ports./private_data./a> = .a href="+code=hpriv" ci_platform.c#L93" id3.L92" class="line" 2 namv3.L123">4153./a>             2     2    goto .a hrvoidpriv" class="sre__io;=hpriv.> = .a href="+code=devm_ioremap" class="sref"/a>->.a href="+code=mmio" class="sref">mmio./a>);=4154./a>        }=rc./a> = u2">4132./a>driveru3a hrevsref">rc./a> = htl=4155./a>=rc./a>;=4156./a>        .a hr2f="+c25/ahci_platform.c#L207" id3.L207" class="line" namv3.L127">4157./a>             2  .a 25"+code=host" clasp" class="sref"/a>->.a href="+code=mmio" class="sref">mmio./a/a> & .a href="+code=ATA_FLAG_EM" class="sref">AHCI_Hvers/aO_SUSPENDuptst_activate"AHCI_Hvers/aO_SUSPENDa/ahcci_platform.c#L193" id3.L193" class="line2 namv3.L128">4158./a>             2  .a 2ref="+code=pdata" class="sref">pdata.err./a>(.a href="+code=dev" class="sref">dev./a>, .spau class="string">"clock prepare enable failefirmw="dru=devee=4159./a>=EINVAL./a> .spau class=L.//ahci_platform.c#L103" id3.L103" class="line2 namv3.L120">4160./a>        .spau2class26ivers/ata/ahci_platform.c#L181" id3.L181" class="line2 namv3.L121">4161./a>        if (.2 href26/ahci_platform.c#L202" id3.L202" class="line" namv3.L122">4162./a>             2  .a 2ref="+code=pi"spaue=4163./a>=4164./a>        if (.2 href2"+code     * Some platforms might need toftw="drmustport */. s="s_RQkrs e=ms="toe=4165./a>             2  .a 26>         * Some platforms might need transitsed  so./spHBA"toeD3 ahcieata/ahci_platform.c#L173" id3.L173" class="line2 namv3.L126">4166./a>=4167./a>        .a hr2f="+c2de=ahci_set_em_messages" clashtl=dev./a>,> = .a href="+code=devm_iore="sref">ap./a>-&gef="+cT=4168./a>=ap./a>-&gef="+IRQ_EARALLEL_SCAN./a>ef="+IRQ_EA/ahci_platform.c#L103" id3.L103" class="line2 namv3.L129">4169./a>        .spau2class26e=hpriv" class="sref">hpriv.writel=dev./a>,htl=mem./a>); = .a href="+code=devm_iore="sref">ap./a>-&gef="+cT=417tioa>.spau class="2ommen27e=irq" class="sref">irq./a> readl=dev./a>,> = .a href="+code=devm_iore="sref">ap./a>-&gef="+cT=4171./a>.spau class="2ommen27/ahci_platform.c#L202" id3.L202" class="line" namv3.L122">4172./a>.spau class="2ommen27e=ahci_print_info" class="sr.a href="+code=ata_host_activate" class="sref">atasuspen;.a href="+code=href">atasuspen; class="sref">hpriv./, .a href="+code=irq" class="sref">irq./a>,PMSG_SUSPENDuptst_activate"PMSG_SUSPENDa/ahci_platform.c#L93" id3.L9193" class="line2 namv3.L123">4173./a>.spau class="2ommen27   goto .a hrclass="sref">pdata.a href="drivers/ata/ahci_platform.c#L209" id3.L209" class="line" namv3.L124">4174./a>        .a hr2f="+c2de=n_ports" clcode=devVAL" clsref">rc./a>;=4175./a>=4176./a>        .a hr2f="+c27+code=pdata" class="sref">pdata./a> && .a href="+code=pdata" class="sref">pdata./a>->.a href="+code=init" class="sref">init./asuspen;.a href="+code=suspen; clai_platform.c#L209" id3.L209" class="line" namv3.L127">4177./a>        if (!2a hre27n -.a href="+code=EINVAL" cls="sref">pdata./a>->.a href="+code=init" class="sref">init./asuspen;.a href="+code=suspen; cla="sref">dev./a>);=4178./a>             2  .a 27/ahci_platform.c#L119" id3.L119" class="line2 namv3.L129">4179./a>             2  got27+code=pi" class="s="sref">host./aa./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4180./a>        }=hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4181./a>=4182./a>        .a hr2f="+c2de=host" classMEM" cl0i_platform.c#L210" id3.L210" class="line" namv3.L123">4183./a>=4184./a>        if (!2.a hr28/ahci_platform.c#L195" id3.L195" class="line2 namv3.L125">4185./a>             2  .a 2ref="+ahci_probv" class="sref">ahci_presum=riv./a> *.a href="+cresum= clashost" class="sref">atae./a> *.a href="+code=dev" class="sref">dev./a> = &.a href="+code=pdei_platform.c#L209" id3.L209" class="line" namv3.L126">4186./a>        else=2a hre2="drivi_platform.c#L193" id3.L193" class="line2 namv3.L127">4187./a>             2  .a 2ref="+code=pri_platform_data" class="sref">ahci_platform_data./a> *.a href="+code=pdata" class="sref">pdata./a> = .a href="+code=dev_get_platdata" class="sref">dev_get_platdata./a>(.a href="+code=dev" class="sref">dev./a>);=4188./a>=host./a>;=devdrv_platdata./a>(.a href="+coddrv_plalass="sref">dev./a>);=4189./a>        if (.2 href2"+code=pi" cla_platform_data" class="srefci_host_priv./a> *.a href="+code=hpriv" class="sref">hpriv./a>;=host./a>->.a href="+code=ports" class="sref">ports./private_data./a> = .a href="+code=hpriv" ci_platform.c#L93" id3.L92" class="l"line2 namv3.L120">4190./a>             2  .a 2ref="+code=ahcls="sref">rc./a>;=4191./a>=4192./a>        for (2a hre2="+code=i" class="s="sref">host./aa./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4193./a>             2  str2ct4.a href="+code=ata_info" class="sr.a href="+code=ata_host_activate" class=""sref">clk_prepare_enable./a>(.a href="+code=hpriv" class="sref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>);=4194./a>=rc./a>) {=4195./a>             2  .a 2ref="+code=ata_port_deossible port, so./spaue>7vers/ata/ahci_ap./a>, .2au class="string">"2mio &237;pR"ports./private_data./a> = .a href="+code=hpriv" ci_platform.sref">dev="+code=ap" class="sref"2ap./a29ata./a>->.a href="L182" class="line2 namv3.L122">4182./a>  _no./a> *20x80);=4182./a>  _f="driver8./a>                .sp2u cla29f="+code=mask_port_map" class="sref">mask_po3ef="+code3flags" class="sref">flag3./a> 3amp; .a href="103" id3.L103" class="line2 namv3.L125">4175./a>=4184       if a href="drivers/ata/ahci_platform.c#L138" 3href="+co3e=hpriv" class="sref">hp3iv./a30">pdata./a>->.a href="+code=init" class="sref">init./a>) {=4184       if i_platform_data" class="host./a> *.a href="+code=host" class="sref">host./a>;=;=irq./a>,PMSG_SUSPENDuptst_activate"PMSG_SUSPENDa/ahci_platfor3e" namv3.3202">4202./a>           3    .3pau class="comment">/*********="+code=rc" class="sref">rc./a>)=4153./a>  3ef="+code3port_map" class="sref">p3rt_ma30ref">hpriv./a>->.a href="+code=clk" class="sref">c3ps" class3"sref">ops./a> = &.a3href=30       .a hr2f="+c2de=n_ports" clcode=devVAL3ps./a>;=<3 href="drivers/ata/ahci_3latfo30_platform.c#L103" id3.L103" clas class="host./a> *.a hrefdrivers/ata/ahci_platfw.L210">4210./a>==4210./a>==4210./a>=) {{=;=<3 "+code=ap" class="sref"3ta/ah30" id3.L136" class="line" namv3.L136">4136./a>        } else {=4207./a>        .a href="+code=rc" class="sref">rc./a> = .a href="+code=ah3i_reset_c3ntroller" class="sref">a3ci_re30ref">hpriv./a>->.a href="+code=clk" class="sref">clk./a>);=rc./a> = .a href="+code=ah3i9reset_c3n./a>                .sp3v3.L238">4208./a>        if ********="+code=rc" class="sref">rc./a>)=4153./a>  3"line" na3v3.L209">4209./a>       3     3  goto .a href="+code=pdata_exit" class="sref3>pdata_ex3t./a>;=pdata./a>->.a href="+code=init"class="line" namv3.L210">4210./a>=4211./a>        .a href="+code=3hci_init_3ontroller" class="sref">3hci_i31 id3.L141" class="line" namv3.L141">4141./a>         3info./a>(3a href="+code=host" clas3="sre3">host./a>, .spau class="string">"platfo3m"4184.02" id3.ine2 nahci_platform.c#L211" id3.L211" class="line" namv3.L211">4211./a>        .a href="+code=3hs" class3t" class="sref">ahci_int3rrupt31       .a hr2f="+c2de=n_ports" clcode=devVAL3 href="dr32ers/a21ef="+code=ata_po3t_dee3eeeeeeeeeeeeel93" id3.L93" class="line" 2 namv3.L121">4181./a>3.c#L213" 3d3.L213" class="line" na3v3.L231t;.a href="+code=ports" class="sref">ports./3"line" na3v3.L127">4117./a>       3     3  .a 2de=rc" class="sref">rc./a>)=)) {=4178./a>             2  .a 27/ahci_platform.c#L119" id3.L119" class="line2 namv3.L129">4179./a>             2  got27+code=pi" class="s="sref">3hpriv./a>->.a href="+code=clk" class="sref">clk./a>)) {=4180./a>        }=32">4190./a>             2  .a 2ref="+code=ahc3&&3 .a href="+code=pdata" c3ass="32_platform.c#L93" id3nit" class="sreref">ports./private_data./a> = .a href="+code=hpriv" ci_platfor3ef">pdata3/a>->.a href="+code=i3it" c32 id3.L182" class="line2 namv3.L122">4182./a> 3ne" 2 nam33.L123">4123./a>        3=4182./a> 3ns" class3>(.a href="+code=hpriv" 3lass=32       .a hr2f="+c2de=n_ports" clcode=devVAL3 href="dr3vers/f=form.c#nit" class="sreSIMPLE_DEVpau OP184./a>        iSIMPLE_DEVpau OP1orm.c#L119" id3.L119ts" clm                    s" clm     class=L119" id3.L119ts" c= CONFIs/at_SLEEMP./a>;=4184./a>        if et_em" class="srefhref=ports./3ost./aa./3>(.a href="+code=hpriv" 3lass=32s="2ommen2">ivestata./a>(.a href="+coddrof_lass="_iIs/at_SLEEMP./a>of_lass="_iIplatf=L119" id3.L119ts" cof_matchamv3.L124">4184./a> of_matchplat[] {=href="drivers/ata/ahci_platform.c#L138" 3> = href=3>(.a href="+code=dev=u> 3lass=3sref">hpriv./a{ 88./a>=4195./asnps,ef=ar-plat  .a href="+cod} class="sref">irq./a>, .a href="+code=ah3L93" id3.393" class="line" 2 namv33L129"33ref">hpriv./a{} class="sref">irq./a>, .a href="+code=ah3L10" id3.3>pdata.a href="drivers/a3a/ahc3_platf}t_em" class="srefhref=4130./a>             2  ret3rn -.3ref">m8./a>=ofNFIsss=L119" id3.L119ts" cof_matchamv3.L124">4184./a> of_matchplatet_em" class="srefhref=ahci_hosto; clashost" c3ass="33>host./a>, .spau class="string">"platfo3sref">hos3./a>;=ta./a>(.a href="+coddr2a hre2="d clas210">4210./a>=4210./a>=dev.3a> = &.a href="+code3pdev"3="sref">host./88./a>=4210./a>=4210./a>=<="dritrobaNFIssref="drivers/ata/ahci_platform.c#L138" 3rhref="dr3ev_get_platdata" class="3ref">3ev_get_platdat88./a>=4184  movnelse {=4184.02"fa hre2="  movn_onnNFIssref="drivers/ata/ahci_platform.c#L138" 3rc#L213" 3rs/ata/ahcass="sref">hos3./a>-337_get_platdat88./a>=4210./a>= = .a href="+code=h3riv" 33ref">hpriv./a>->.a88./a>=4210./a>=<+codelse {=<"line2 namv3.L125">4195./aplat  .a href="+coref="drivers/ata/ahci_platform.c#L138" 3r = href=3 .a href="+code=pdata" c3ass="3ref">pdata./a>->.a 88./a>=4210./a>=4210./a>=pdata3/a>->.a href="+code=i3it" c34ref">hpriv./a>->.a88./a>=4184./a> of_matchplatsref="drivers/ata/ahci_platform.c#L138" 3e10" id3.3./a>);=pdata./a>->.a hr88./a>=413.a href="+code=hpriv" cl3ss="s3ef">hpriv./a>-} class="sref">irq./a>, .a href="+code=ah3 href="dr3vers/f=hpriv./a88./a>=hpriv./{=hos3>(.a href="+code=dev=u> 3lass=3sref">}t_em" class="srefhref=4210./a>=4210./a>=   3    .spau2class2"comment3>/*./3_platform.c#L206" id3.L206" class="line" namv3.L125">4135./a>.spau class="2ommen3">   3i_plat8./a>=4195./a.a 2rSATA ="line"  " id3.code=ata_port_deossible port, so./spaue>7vers/ata/ahci3lass="lin3" namv3.L127">4147./a>.s3au cl34 .a 2de=rc" class="sMODULE_AUTHOe2 namv3.L128">4MODULE_AUTHOeorm.c#"line2 namv3.L125">4195./a.nton Vorontsov203">avorontsov@ru.mvimme.1om0./acode=ata_port_deossible port, so./spaue>7vers/ata/ahci3l = href=3+code=hci_psuspen; clash3st" c3ass="sde=rc" class="sMODULE_LICENSEm.c#L193" id3.LMODULE_LICENSEorm.c#"line2 namv3.L125">4195./aGPLcode=ata_port_deossible port, so./spaue>7vers/ata/ahci3"sref">de3./a> = &.a href="+co3e=pde35 id3.L119" class="liMODULE_ALIA184./a>        iMODULE_ALIA1orm.c#"line2 namv3.L125">4195./aers/ata/:plat  .a href="+c_deossible port, so./spaue>7vers/ata/ahci3"10" id3.3ev_get_platdata" class="3ref">3ev_get


The original LXR s"driversbys_RQkossible phttp://sourceatage.net/projects/lxs2>LXR e=irunityNFIsssthis experirq" al , so/. sbysossible pmailto:lxs@datux.no">lxs@datux.nohref8
lxs.datux.no kindly lineedsbysossible phttp://www.redpill-datpro.no">Redpill Latpro A1orm., providers="sLatux>ivesuli_platnd opera*/. s serss="s sinceass=5.