linux/drivers/mfd/wm8994-core.c
<<
n> .4"/spa="v .4"/form"v .4"a n> .4 href="../linux+v3pti2/drivers/mfd/wm8994-core.c">n> .4"img src="../.static/gfx/right.png" alt=">>">n>"/spa="vn>"spa= class="lxr_search">n> =="+search" method="post" onsubmit="return do_search(this);">n> .4"input typ3.4hidden" nam3.4navtarget" > v3.4">n> .4"input typ3.4text" nam3.4search" id.4search">n> .4"butt>22typ3.4submit">Search2"v .4"/form"v "/spa="vn>"spa= class="lxr_prefs""v .4"a href="+prefs?return=drivers/mfd/wm8994-core.c"n> .4 onclick="return ajax_prefs();">n> .4Prefsv .4"/a>n>"/spa="v .4 4"/div"v .4 4"form ac2> =="ajax+*" method="post" onsubmit="return false;">n>"input typ3.4hidden" nam3.4ajax_lookup" id.4ajax_lookup" > v3.4">n .4 4"/form"vn .4 4"div class="headingbott>m">v "div id.4file_contents""
4 41"/a>"spa= class="comment">/*"/spa="v4 42"/a>"spa= class="comment"> * wm8994-core.c  --  Device access for Wolfs>22WM8994"/spa="v4 43"/a>"spa= class="comment"> *"/spa="v4 44"/a>"spa= class="comment"> * Copyright 2009 Wolfs>22Microelectronics PLC."/spa="v4 45"/a>"spa= class="comment"> *"/spa="v4 46"/a>"spa= class="comment"> * Author: Mark Brown <broonie@opensource.wolfs>2micro.com>"/spa="v4 47"/a>"spa= class="comment"> *"/spa="v4 48"/a>"spa= class="comment"> *  This program is free software; you ca= redistribute  it and/or modify it"/spa="v4 49"/a>"spa= class="comment"> *  under  the terms of  the GNU General.4Public License as published by the"/spa="v4   >1a>"spa= class="comment"> *  Free Software Founda2>
=;  either vers >222 of the  License, or (at your"/spa="v4 11"/a>"spa= class="comment"> *  >22>
=) any later vers >2."/spa="v4 12"/a>"spa= class="comment"> *"/spa="v4 13"/a>"spa= class="comment"> */"/spa="v4 14"/a>v4 15"/a>#include <linux/kernel.h"/a>>v4 16"/a>#include <linux/module.h"/a>>v4 17"/a>#include <linux/slab.h"/a>>v4 18"/a>#include <linux/i2c.h"/a>>v4 19"/a>#include <linux/err.h"/a>>v4 20"/a>#include <linux/delay.h"/a>>v4 21"/a>#include <linux/mfd/core.h"/a>>v4 22"/a>#include <linux/pm_runtime.h"/a>>v4 23"/a>#include <linux/regmap.h"/a>>v4 24"/a>#include <linux/regulator/consumer.h"/a>>v4 25"/a>#include <linux/regulator/machine.h"/a>>v4 26"/a>v4 27"/a>#include <linux/mfd/wm8994/core.h"/a>>v4 28"/a>#include <linux/mfd/wm8994/pda2a.h"/a>>v4 29"/a>#include <linux/mfd/wm8994/registers.h"/a>>v4 30"/a>v4 31"/a>#include "wm8994.h"/a>"v4 32"/a>v4 33"/a>"spa= class="comment">/**"/spa="v4 34"/a>"spa= class="comment"> * wm8994_reg_read: Read a single2WM8994 register."/spa="v4 35"/a>"spa= class="comment"> *"/spa="v4 36"/a>"spa= class="comment"> * @wm8994: Device to read from."/spa="v4 37"/a>"spa= class="comment"> * @reg: Register to read."/spa="v4 38"/a>"spa= class="comment"> */"/spa="v4 39"/a>int4"a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>(struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>, unsigned short4"a href="+code=reg" class="sref">reg"/a>)v4 40"/a>{v4 41"/a>        unsigned int4"a href="+code=val" class="sref">val"/a>;v4 42"/a>        int4"a href="+code=ret" class="sref">ret"/a>;v4 43"/a>v4 44"/a>        "a href="+code=ret" class="sref">ret"/a> =4"a href="+code=regmap_read" class="sref">regmap_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=reg" class="sref">reg"/a>, &"a href="+code=val" class="sref">val"/a>);v4 45"/a>v4 46"/a>        if ("a href="+code=ret" class="sref">ret"/a> < 0)v4 47"/a>                return "a href="+code=ret" class="sref">ret"/a>;v4 48"/a>        elsev4 49"/a>                return "a href="+code=val" class="sref">val"/a>;v4 50"/a>}v4 51"/a>"a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL"/a>("a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>);v4 52"/a>v4 53"/a>"spa= class="comment">/**"/spa="v4 54"/a>"spa= class="comment"> * wm8994_bulk_read: Read multiple2WM8994 registers"/spa="v4 55"/a>"spa= class="comment"> *"/spa="v4 56"/a>"spa= class="comment"> * @wm8994: Device to read from"/spa="v4 57"/a>"spa= class="comment"> * @reg: First register"/spa="v4 58"/a>"spa= class="comment"> * @count: Number of registers"/spa="v4 59"/a>"spa= class="comment"> * @buf: Buffer to fill.  The da2a will be returned big endia2."/spa="v4 6 >1a>"spa= class="comment"> */"/spa="v4 61"/a>int4"a href="+code=wm8994_bulk_read" class="sref">wm8994_bulk_read"/a>(struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>, unsigned short4"a href="+code=reg" class="sref">reg"/a>,v4 62"/a>                     int4"a href="+code=count" class="sref">count"/a>, "a href="+code=u16" class="sref">u16"/a> *"a href="+code=buf" class="sref">buf"/a>)v4 63"/a>{v4 64"/a>        return "a href="+code=regmap_bulk_read" class="sref">regmap_bulk_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=reg" class="sref">reg"/a>, "a href="+code=buf" class="sref">buf"/a>, "a href="+code=count" class="sref">count"/a>);v4 65"/a>}v4 66"/a>v4 67"/a>"spa= class="comment">/**"/spa="v4 68"/a>"spa= class="comment"> * wm8994_reg_write: Write a single2WM8994 register."/spa="v4 69"/a>"spa= class="comment"> *"/spa="v4 7 >1a>"spa= class="comment"> * @wm8994: Device to write to."/spa="v4 71"/a>"spa= class="comment"> * @reg: Register to write to."/spa="v4 72"/a>"spa= class="comment"> * @val: V  v3 to write."/spa="v4 73"/a>"spa= class="comment"> */"/spa="v4 74"/a>int4"a href="+code=wm8994_reg_write" class="sref">wm8994_reg_write"/a>(struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>, unsigned short4"a href="+code=reg" class="sref">reg"/a>,v4 75"/a>                     unsigned short4"a href="+code=val" class="sref">val"/a>)v4 76"/a>{v4 77"/a>        return "a href="+code=regmap_write" class="sref">regmap_write"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=reg" class="sref">reg"/a>, "a href="+code=val" class="sref">val"/a>);v4 78"/a>}v4 79"/a>"a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL"/a>("a href="+code=wm8994_reg_write" class="sref">wm8994_reg_write"/a>);v4 80"/a>v4 81"/a>"spa= class="comment">/**"/spa="v4 82"/a>"spa= class="comment"> * wm8994_bulk_write: Write multiple2WM8994 registers"/spa="v4 83"/a>"spa= class="comment"> *"/spa="v4 84"/a>"spa= class="comment"> * @wm8994: Device to write to"/spa="v4 85"/a>"spa= class="comment"> * @reg: First register"/spa="v4 86"/a>"spa= class="comment"> * @count: Number of registers"/spa="v4 87"/a>"spa= class="comment"> * @buf: Buffer to write from.  Da2a must be big-endia2 formatted."/spa="v4 88"/a>"spa= class="comment"> */"/spa="v4 89"/a>int4"a href="+code=wm8994_bulk_write" class="sref">wm8994_bulk_write"/a>(struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>, unsigned short4"a href="+code=reg" class="sref">reg"/a>,v4 90"/a>                      int4"a href="+code=count" class="sref">count"/a>, const4"a href="+code=u16" class="sref">u16"/a> *"a href="+code=buf" class="sref">buf"/a>)v4 91"/a>{v4 92"/a>        return "a href="+code=regmap_raw_write" class="sref">regmap_raw_write"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=reg" class="sref">reg"/a>, "a href="+code=buf" class="sref">buf"/a>, "a href="+code=count" class="sref">count"/a> * sizeof("a href="+code=u16" class="sref">u16"/a>));v4 93"/a>}v4 94"/a>"a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL"/a>("a href="+code=wm8994_bulk_write" class="sref">wm8994_bulk_write"/a>);v4 95"/a>v4 96"/a>"spa= class="comment">/**"/spa="v4 97"/a>"spa= class="comment"> * wm8994_set_bits: Set the >  v3 of a bitfield in a WM8994 register"/spa="v4 98"/a>"spa= class="comment"> *"/spa="v4 99"/a>"spa= class="comment"> * @wm8994: Device to write to."/spa="v4100"/a>"spa= class="comment"> * @reg: Register to write to."/spa="v4101"/a>"spa= class="comment"> * @mask: Mask of bits to set."/spa="v4102"/a>"spa= class="comment"> * @val: V  v3 to set (unshifted)"/spa="v4103"/a>"spa= class="comment"> */"/spa="v4104"/a>int4"a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>(struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>, unsigned short4"a href="+code=reg" class="sref">reg"/a>,v4105"/a>                    unsigned short4"a href="+code=mask" class="sref">mask"/a>, unsigned short4"a href="+code=val" class="sref">val"/a>)v4106"/a>{v4107"/a>        return "a href="+code=regmap_upda2e_bits" class="sref">regmap_upda2e_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=reg" class="sref">reg"/a>, "a href="+code=mask" class="sref">mask"/a>, "a href="+code=val" class="sref">val"/a>);v4108"/a>}v4109"/a>"a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL"/a>("a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>);v4110"/a>v4111"/a>static struct4"a href="+code=mfd_cell" class="sref">mfd_cell"/a> "a href="+code=wm8994_regulator_devs" class="sref">wm8994_regulator_devs"/a>[] = {v4112"/a>        {v4113"/a>                ."a href="+code=nam3" class="sref">nam3"/a> = "spa= class="string">"wm8994-ldo"4114"/a>                ."a href="+code=id" class="sref">id"/a> = 1,v4115"/a>                ."a href="+code=pm_runtime_no_callbacks" class="sref">pm_runtime_no_callbacks"/a> = "a href="+code=tru3" class="sref">tru3"/a>,v4116"/a>        },v4117"/a>        {v4118"/a>                ."a href="+code=nam3" class="sref">nam3"/a> = "spa= class="string">"wm8994-ldo"4119"/a>                ."a href="+code=id" class="sref">id"/a> = 2,v4120"/a>                ."a href="+code=pm_runtime_no_callbacks" class="sref">pm_runtime_no_callbacks"/a> = "a href="+code=tru3" class="sref">tru3"/a>,v4121"/a>        },v4122"/a>};v4123"/a>v4124"/a>static struct4"a href="+code=resource" class="sref">resource"/a> "a href="+code=wm8994_codec_resources" class="sref">wm8994_codec_resources"/a>[] = {v4125"/a>        {v4126"/a>                ."a href="+code=start" class="sref">start"/a> = "a href="+code=WM8994_IRQ_TEMP_SHUT" class="sref">WM8994_IRQ_TEMP_SHUT"/a>,v4127"/a>                ."a href="+code=end" class="sref">end"/a>   = "a href="+code=WM8994_IRQ_TEMP_WARN" class="sref">WM8994_IRQ_TEMP_WARN"/a>,v4128"/a>                ."a href="+code=flags" class="sref">flags"/a> = "a href="+code=IORESOURCE_IRQ" class="sref">IORESOURCE_IRQ"/a>,v4129"/a>        },v4130"/a>};v4131"/a>v4132"/a>static struct4"a href="+code=resource" class="sref">resource"/a> "a href="+code=wm8994_gpio_resources" class="sref">wm8994_gpio_resources"/a>[] = {v4133"/a>        {v4134"/a>                ."a href="+code=start" class="sref">start"/a> = "a href="+code=WM8994_IRQ_GPIO" class="sref">WM8994_IRQ_GPIO"/a>(1),v4135"/a>                ."a href="+code=end" class="sref">end"/a>   = "a href="+code=WM8994_IRQ_GPIO" class="sref">WM8994_IRQ_GPIO"/a>(11),v4136"/a>                ."a href="+code=flags" class="sref">flags"/a> = "a href="+code=IORESOURCE_IRQ" class="sref">IORESOURCE_IRQ"/a>,v4137"/a>        },v4138"/a>};v4139"/a>v4140"/a>static struct4"a href="+code=mfd_cell" class="sref">mfd_cell"/a> "a href="+code=wm8994_devs" class="sref">wm8994_devs"/a>[] = {v4141"/a>        {v4142"/a>                ."a href="+code=nam3" class="sref">nam3"/a> = "spa= class="string">"wm8994-codec"4143"/a>                ."a href="+code=num_resources" class="sref">num_resources"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_codec_resources" class="sref">wm8994_codec_resources"/a>),v4144"/a>                ."a href="+code=resources" class="sref">resources"/a> = "a href="+code=wm8994_codec_resources" class="sref">wm8994_codec_resources"/a>,v4145"/a>        },v4146"/a>v4147"/a>        {v4148"/a>                ."a href="+code=nam3" class="sref">nam3"/a> = "spa= class="string">"wm8994-gpio"4149"/a>                ."a href="+code=num_resources" class="sref">num_resources"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_gpio_resources" class="sref">wm8994_gpio_resources"/a>),v4150"/a>                ."a href="+code=resources" class="sref">resources"/a> = "a href="+code=wm8994_gpio_resources" class="sref">wm8994_gpio_resources"/a>,v4151"/a>                ."a href="+code=pm_runtime_no_callbacks" class="sref">pm_runtime_no_callbacks"/a> = "a href="+code=tru3" class="sref">tru3"/a>,v4152"/a>        },v4153"/a>};v4154"/a>v4155"/a>"spa= class="comment">/*"/spa="v4156"/a>"spa= class="comment"> * Supplies for the main bulk of CODEC; the LDO supplies are ignored"/spa="v4157"/a>"spa= class="comment"> * and should be handled via the standard regulator API supply"/spa="v4158"/a>"spa= class="comment"> * management."/spa="v4159"/a>"spa= class="comment"> */"/spa="v4160"/a>static const4char *"a href="+code=wm1811_main_supplies" class="sref">wm1811_main_supplies"/a>[] = {v4161"/a>        "spa= class="string">"DBVDD1"4162"/a>        "spa= class="string">"DBVDD2"4163"/a>        "spa= class="string">"DBVDD3"4164"/a>        "spa= class="string">"DCVDD"4165"/a>        "spa= class="string">"AVDD1"4166"/a>        "spa= class="string">"AVDD2"4167"/a>        "spa= class="string">"CPVDD"4168"/a>        "spa= class="string">"SPKVDD1"4169"/a>        "spa= class="string">"SPKVDD2"4170"/a>};v4171"/a>v4172"/a>static const4char *"a href="+code=wm8994_main_supplies" class="sref">wm8994_main_supplies"/a>[] = {v4173"/a>        "spa= class="string">"DBVDD"4174"/a>        "spa= class="string">"DCVDD"4175"/a>        "spa= class="string">"AVDD1"4176"/a>        "spa= class="string">"AVDD2"4177"/a>        "spa= class="string">"CPVDD"4178"/a>        "spa= class="string">"SPKVDD1"4179"/a>        "spa= class="string">"SPKVDD2"4180"/a>};v4181"/a>v4182"/a>static const4char *"a href="+code=wm8958_main_supplies" class="sref">wm8958_main_supplies"/a>[] = {v4183"/a>        "spa= class="string">"DBVDD1"4184"/a>        "spa= class="string">"DBVDD2"4185"/a>        "spa= class="string">"DBVDD3"4186"/a>        "spa= class="string">"DCVDD"4187"/a>        "spa= class="string">"AVDD1"4188"/a>        "spa= class="string">"AVDD2"4189"/a>        "spa= class="string">"CPVDD"4190"/a>        "spa= class="string">"SPKVDD1"4191"/a>        "spa= class="string">"SPKVDD2"4192"/a>};v4193"/a>v4194"/a>#ifdef "a href="+code=CONFIG_PM" class="sref">CONFIG_PM"/a>v4195"/a>static int4"a href="+code=wm8994_suspend" class="sref">wm8994_suspend"/a>(struct4"a href="+code=device" class="sref">device"/a> *"a href="+code=dev" class="sref">dev"/a>)v4196"/a>{v4197"/a>        struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a> = "a href="+code=dev_get_drvda2a" class="sref">dev_get_drvda2a"/a>("a href="+code=dev" class="sref">dev"/a>);v4198"/a>        int4"a href="+code=ret" class="sref">ret"/a>;v4199"/a>v4200"/a>        "spa= class="comment">/* Don't ac2ually go through with the suspend if the CODEC is"/spa="v4201"/a>"spa= class="comment">         * still ac2>ve (eg, for audio passthrough from CP. */"/spa="v4202"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_POWER_MANAGEMENT_1" class="sref">WM8994_POWER_MANAGEMENT_1"/a>);v4203"/a>        if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4204"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read power status: %d\n"ret"/a>);v4205"/a>        } else if ("a href="+code=ret" class="sref">ret"/a> & "a href="+code=WM8994_VMID_SEL_MASK" class="sref">WM8994_VMID_SEL_MASK"/a>) {v4206"/a>                "a href="+code=dev_dbg" class="sref">dev_dbg"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"CODEC still ac2>ve, ignoring suspend\n"4207"/a>                return 0;v4208"/a>        }v4209"/a>v4210"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_POWER_MANAGEMENT_4" class="sref">WM8994_POWER_MANAGEMENT_4"/a>);v4211"/a>        if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4212"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read power status: %d\n"ret"/a>);v4213"/a>        } else if ("a href="+code=ret" class="sref">ret"/a> & ("a href="+code=WM8994_AIF2ADCL_ENA" class="sref">WM8994_AIF2ADCL_ENA"/a> | "a href="+code=WM8994_AIF2ADCR_ENA" class="sref">WM8994_AIF2ADCR_ENA"/a> |v4214"/a>                          "a href="+code=WM8994_AIF1ADC2L_ENA" class="sref">WM8994_AIF1ADC2L_ENA"/a> | "a href="+code=WM8994_AIF1ADC2R_ENA" class="sref">WM8994_AIF1ADC2R_ENA"/a> |v4215"/a>                          "a href="+code=WM8994_AIF1ADC1L_ENA" class="sref">WM8994_AIF1ADC1L_ENA"/a> | "a href="+code=WM8994_AIF1ADC1R_ENA" class="sref">WM8994_AIF1ADC1R_ENA"/a>)) {v4216"/a>                "a href="+code=dev_dbg" class="sref">dev_dbg"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"CODEC still ac2>ve, ignoring suspend\n"4217"/a>                return 0;v4218"/a>        }v4219"/a>v4220"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_POWER_MANAGEMENT_5" class="sref">WM8994_POWER_MANAGEMENT_5"/a>);v4221"/a>        if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4222"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read power status: %d\n"ret"/a>);v4223"/a>        } else if ("a href="+code=ret" class="sref">ret"/a> & ("a href="+code=WM8994_AIF2DACL_ENA" class="sref">WM8994_AIF2DACL_ENA"/a> | "a href="+code=WM8994_AIF2DACR_ENA" class="sref">WM8994_AIF2DACR_ENA"/a> |v4224"/a>                          "a href="+code=WM8994_AIF1DAC2L_ENA" class="sref">WM8994_AIF1DAC2L_ENA"/a> | "a href="+code=WM8994_AIF1DAC2R_ENA" class="sref">WM8994_AIF1DAC2R_ENA"/a> |v4225"/a>                          "a href="+code=WM8994_AIF1DAC1L_ENA" class="sref">WM8994_AIF1DAC1L_ENA"/a> | "a href="+code=WM8994_AIF1DAC1R_ENA" class="sref">WM8994_AIF1DAC1R_ENA"/a>)) {v4226"/a>                "a href="+code=dev_dbg" class="sref">dev_dbg"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"CODEC still ac2>ve, ignoring suspend\n"4227"/a>                return 0;v4228"/a>        }v4229"/a>v4230"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4231"/a>        case "a href="+code=WM8958" class="sref">WM8958"/a>:v4232"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4233"/a>                "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8958_MIC_DETECT_1" class="sref">WM8958_MIC_DETECT_1"/a>);v4234"/a>                if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4235"/a>                        "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read power status: %d\n"ret"/a>);v4236"/a>                } else if ("a href="+code=ret" class="sref">ret"/a> & "a href="+code=WM8958_MICD_ENA" class="sref">WM8958_MICD_ENA"/a>) {v4237"/a>                        "a href="+code=dev_dbg" class="sref">dev_dbg"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"CODEC still ac2>ve, ignoring suspend\n"4238"/a>                        return 0;v4239"/a>                }v4240"/a>                break;v4241"/a>        default:v4242"/a>                break;v4243"/a>        }v4244"/a>v4245"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4246"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4247"/a>                "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_ANTIPOP_2" class="sref">WM8994_ANTIPOP_2"/a>);v4248"/a>                if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4249"/a>                        "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read jackdet: %d\n"ret"/a>);v4250"/a>                } else if ("a href="+code=ret" class="sref">ret"/a> & "a href="+code=WM1811_JACKDET_MODE_MASK" class="sref">WM1811_JACKDET_MODE_MASK"/a>) {v4251"/a>                        "a href="+code=dev_dbg" class="sref">dev_dbg"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"CODEC still ac2>ve, ignoring suspend\n"4252"/a>                        return 0;v4253"/a>                }v4254"/a>                break;v4255"/a>        default:v4256"/a>                break;v4257"/a>        }v4258"/a>v4259"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4260"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4261"/a>                "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_ANTIPOP_2" class="sref">WM8994_ANTIPOP_2"/a>);v4262"/a>                if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4263"/a>                        "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read jackdet: %d\n"ret"/a>);v4264"/a>                } else if ("a href="+code=ret" class="sref">ret"/a> & "a href="+code=WM1811_JACKDET_MODE_MASK" class="sref">WM1811_JACKDET_MODE_MASK"/a>) {v4265"/a>                        "a href="+code=dev_dbg" class="sref">dev_dbg"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"CODEC still ac2>ve, ignoring suspend\n"4266"/a>                        return 0;v4267"/a>                }v4268"/a>                break;v4269"/a>        default:v4270"/a>                break;v4271"/a>        }v4272"/a>v4273"/a>        "spa= class="comment">/* Disable LDO pulldowns while the device is suspended if we"/spa="v4274"/a>"spa= class="comment">         * don't know that something will be driving them. */"/spa="v4275"/a>        if (!"a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=ldo_ena_always_driven" class="sref">ldo_ena_always_driven"/a>)v4276"/a>                "a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_PULL_CONTROL_2" class="sref">WM8994_PULL_CONTROL_2"/a>,v4277"/a>                                "a href="+code=WM8994_LDO1ENA_PD" class="sref">WM8994_LDO1ENA_PD"/a> | "a href="+code=WM8994_LDO2ENA_PD" class="sref">WM8994_LDO2ENA_PD"/a>,v4278"/a>                                "a href="+code=WM8994_LDO1ENA_PD" class="sref">WM8994_LDO1ENA_PD"/a> | "a href="+code=WM8994_LDO2ENA_PD" class="sref">WM8994_LDO2ENA_PD"/a>);v4279"/a>v4280"/a>        "spa= class="comment">/* Explicitly put the device into reset in case regulators"/spa="v4281"/a>"spa= class="comment">         * don't get disabled in order to ensure consistent restart."/spa="v4282"/a>"spa= class="comment">         */"/spa="v4283"/a>        "a href="+code=wm8994_reg_write" class="sref">wm8994_reg_write"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_SOFTWARE_RESET" class="sref">WM8994_SOFTWARE_RESET"/a>,v4284"/a>                         "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_SOFTWARE_RESET" class="sref">WM8994_SOFTWARE_RESET"/a>));v4285"/a>v4286"/a>        "a href="+code=regcache_mark_dirty" class="sref">regcache_mark_dirty"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>);v4287"/a>v4288"/a>        "spa= class="comment">/* Restore GPIO registers to prevent problems with mismatched"/spa="v4289"/a>"spa= class="comment">         * pin configurations."/spa="v4290"/a>"spa= class="comment">         */"/spa="v4291"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regcache_sync_region" class="sref">regcache_sync_region"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=WM8994_GPIO_1" class="sref">WM8994_GPIO_1"/a>,v4292"/a>                                   "a href="+code=WM8994_GPIO_11" class="sref">WM8994_GPIO_11"/a>);v4293"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0)v4294"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to restore GPIO registers: %d\n"ret"/a>);v4295"/a>v4296"/a>        "spa= class="comment">/* In case one of the GPIOs is used as a wake input. */"/spa="v4297"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regcache_sync_region" class="sref">regcache_sync_region"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>,v4298"/a>                                   "a href="+code=WM8994_INTERRUPT_STATUS_1_MASK" class="sref">WM8994_INTERRUPT_STATUS_1_MASK"/a>,v4299"/a>                                   "a href="+code=WM8994_INTERRUPT_STATUS_1_MASK" class="sref">WM8994_INTERRUPT_STATUS_1_MASK"/a>);v4300"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0)v4301"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to restore interrupt mask: %d\n"ret"/a>);v4302"/a>v4303"/a>        "a href="+code=regcache_cache_only" class="sref">regcache_cache_only"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=tru3" class="sref">tru3"/a>);v4304"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=suspended" class="sref">suspended"/a> = "a href="+code=tru3" class="sref">tru3"/a>;v4305"/a>v4306"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regulator_bulk_disable" class="sref">regulator_bulk_disable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>,v4307"/a>                                     "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4308"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4309"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to disable supplies: %d\n"ret"/a>);v4310"/a>                return "a href="+code=ret" class="sref">ret"/a>;v4311"/a>        }v4312"/a>v4313"/a>        return 0;v4314"/a>}v4315"/a>v4316"/a>static int4"a href="+code=wm8994_resum3" class="sref">wm8994_resum3"/a>(struct4"a href="+code=device" class="sref">device"/a> *"a href="+code=dev" class="sref">dev"/a>)v4317"/a>{v4318"/a>        struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a> = "a href="+code=dev_get_drvda2a" class="sref">dev_get_drvda2a"/a>("a href="+code=dev" class="sref">dev"/a>);v4319"/a>        int4"a href="+code=ret" class="sref">ret"/a>;v4320"/a>v4321"/a>        "spa= class="comment">/* We may have lied to the PM core about suspending */"/spa="v4322"/a>        if (!"a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=suspended" class="sref">suspended"/a>)v4323"/a>                return 0;v4324"/a>v4325"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regulator_bulk_enable" class="sref">regulator_bulk_enable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>,v4326"/a>                                    "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4327"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4328"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to enable supplies: %d\n"ret"/a>);v4329"/a>                return "a href="+code=ret" class="sref">ret"/a>;v4330"/a>        }v4331"/a>v4332"/a>        "a href="+code=regcache_cache_only" class="sref">regcache_cache_only"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=false" class="sref">false"/a>);v4333"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regcache_sync" class="sref">regcache_sync"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>);v4334"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4335"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to restore register map: %d\n"ret"/a>);v4336"/a>                goto "a href="+code=err_enable" class="sref">err_enable"/a>;v4337"/a>        }v4338"/a>v4339"/a>        "spa= class="comment">/* Disable LDO pulldowns while the device is ac2>ve */"/spa="v4340"/a>        "a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_PULL_CONTROL_2" class="sref">WM8994_PULL_CONTROL_2"/a>,v4341"/a>                        "a href="+code=WM8994_LDO1ENA_PD" class="sref">WM8994_LDO1ENA_PD"/a> | "a href="+code=WM8994_LDO2ENA_PD" class="sref">WM8994_LDO2ENA_PD"/a>,v4342"/a>                        0);v4343"/a>v4344"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=suspended" class="sref">suspended"/a> = "a href="+code=false" class="sref">false"/a>;v4345"/a>v4346"/a>        return 0;v4347"/a>v4348"/a>"a href="+code=err_enable" class="sref">err_enable"/a>:v4349"/a>        "a href="+code=regulator_bulk_disable" class="sref">regulator_bulk_disable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4350"/a>v4351"/a>        return "a href="+code=ret" class="sref">ret"/a>;v4352"/a>}v4353"/a>#endifv4354"/a>v4355"/a>#ifdef "a href="+code=CONFIG_REGULATOR" class="sref">CONFIG_REGULATOR"/a>v4356"/a>static int4"a href="+code=wm8994_ldo_in_use" class="sref">wm8994_ldo_in_use"/a>(struct4"a href="+code=wm8994_pda2a" class="sref">wm8994_pda2a"/a> *"a href="+code=pda2a" class="sref">pda2a"/a>, int4"a href="+code=ldo" class="sref">ldo"/a>)v4357"/a>{v4358"/a>        struct4"a href="+code=wm8994_ldo_pda2a" class="sref">wm8994_ldo_pda2a"/a> *"a href="+code=ldo_pda2a" class="sref">ldo_pda2a"/a>;v4359"/a>v4360"/a>        if (!"a href="+code=pda2a" class="sref">pda2a"/a>)v4361"/a>                return 0;v4362"/a>v4363"/a>        "a href="+code=ldo_pda2a" class="sref">ldo_pda2a"/a> = &"a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=ldo" class="sref">ldo"/a>["a href="+code=ldo" class="sref">ldo"/a>];v4364"/a>v4365"/a>        if (!"a href="+code=ldo_pda2a" class="sref">ldo_pda2a"/a>->"a href="+code=init_da2a" class="sref">init_da2a"/a>)v4366"/a>                return 0;v4367"/a>v4368"/a>        return "a href="+code=ldo_pda2a" class="sref">ldo_pda2a"/a>->"a href="+code=init_da2a" class="sref">init_da2a"/a>->"a href="+code=num_consumer_supplies" class="sref">num_consumer_supplies"/a> != 0;v4369"/a>}v4370"/a>#elsev4371"/a>static int4"a href="+code=wm8994_ldo_in_use" class="sref">wm8994_ldo_in_use"/a>(struct4"a href="+code=wm8994_pda2a" class="sref">wm8994_pda2a"/a> *"a href="+code=pda2a" class="sref">pda2a"/a>, int4"a href="+code=ldo" class="sref">ldo"/a>)v4372"/a>{v4373"/a>        return 0;v4374"/a>}v4375"/a>#endifv4376"/a>v4377"/a>static const4"a href="+code=__devinitda2a" class="sref">__devinitda2a"/a> struct4"a href="+code=reg_default" class="sref">reg_default"/a> "a href="+code=wm8994_revc_patch" class="sref">wm8994_revc_patch"/a>[] = {v4378"/a>        { 0x102, 0x3 },v4379"/a>        { 0x56, 0x3 },v4380"/a>        { 0x817, 0x0 },v4381"/a>        { 0x102, 0x0 },v4382"/a>};v4383"/a>v4384"/a>static const4"a href="+code=__devinitda2a" class="sref">__devinitda2a"/a> struct4"a href="+code=reg_default" class="sref">reg_default"/a> "a href="+code=wm8958_reva_patch" class="sref">wm8958_reva_patch"/a>[] = {v4385"/a>        { 0x102, 0x3 },v4386"/a>        { 0xcb, 0x81 },v4387"/a>        { 0x817, 0x0 },v4388"/a>        { 0x102, 0x0 },v4389"/a>};v4390"/a>v4391"/a>static const4"a href="+code=__devinitda2a" class="sref">__devinitda2a"/a> struct4"a href="+code=reg_default" class="sref">reg_default"/a> "a href="+code=wm1811_reva_patch" class="sref">wm1811_reva_patch"/a>[] = {v4392"/a>        { 0x102, 0x3 },v4393"/a>        { 0x56, 0x7 },v4394"/a>        { 0x5d, 0x7e },v4395"/a>        { 0x5e, 0x0 },v4396"/a>        { 0x102, 0x0 },v4397"/a>};v4398"/a>v4399"/a>"spa= class="comment">/*"/spa="v4400"/a>"spa= class="comment"> * Instantiate the generic non-control parts of the device."/spa="v4401"/a>"spa= class="comment"> */"/spa="v4402"/a>static "a href="+code=__devinit" class="sref">__devinit"/a> int4"a href="+code=wm8994_device_init" class="sref">wm8994_device_init"/a>(struct4"a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>, int4"a href="+code=irq" class="sref">irq"/a>)v4403"/a>{v4404"/a>        struct4"a href="+code=wm8994_pda2a" class="sref">wm8994_pda2a"/a> *"a href="+code=pda2a" class="sref">pda2a"/a> = "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>->"a href="+code=platform_da2a" class="sref">platform_da2a"/a>;v4405"/a>        struct4"a href="+code=regmap_config" class="sref">regmap_config"/a> *"a href="+code=regmap_config" class="sref">regmap_config"/a>;v4406"/a>        const4struct4"a href="+code=reg_default" class="sref">reg_default"/a> *"a href="+code=regmap_patch" class="sref">regmap_patch"/a> = "a href="+code=NULL" class="sref">NULL"/a>;v4407"/a>        const4char *"a href="+code=devnam3" class="sref">devnam3"/a>;v4408"/a>        int4"a href="+code=ret" class="sref">ret"/a>, "a href="+code=i" class="sref">i"/a>, "a href="+code=patch_regs" class="sref">patch_regs"/a>;v4409"/a>        int4"a href="+code=pulls" class="sref">pulls"/a> = 0;v4410"/a>v4411"/a>        "a href="+code=dev_set_drvda2a" class="sref">dev_set_drvda2a"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>);v4412"/a>v4413"/a>        "spa= class="comment">/* Add the on-chip regulators first4for bootstrapping */"/spa="v4414"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=mfd_add_devices" class="sref">mfd_add_devices"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, -1,v4415"/a>                              "a href="+code=wm8994_regulator_devs" class="sref">wm8994_regulator_devs"/a>,v4416"/a>                              "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_regulator_devs" class="sref">wm8994_regulator_devs"/a>),v4417"/a>                              "a href="+code=NULL" class="sref">NULL"/a>, 0, "a href="+code=NULL" class="sref">NULL"/a>);v4418"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4419"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to add4children: %d\n"ret"/a>);v4420"/a>                goto "a href="+code=err" class="sref">err"/a>;v4421"/a>        }v4422"/a>v4423"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4424"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4425"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm1811_main_supplies" class="sref">wm1811_main_supplies"/a>);v4426"/a>                break;v4427"/a>        case "a href="+code=WM8994" class="sref">WM8994"/a>:v4428"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_main_supplies" class="sref">wm8994_main_supplies"/a>);v4429"/a>                break;v4430"/a>        case "a href="+code=WM8958" class="sref">WM8958"/a>:v4431"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8958_main_supplies" class="sref">wm8958_main_supplies"/a>);v4432"/a>                break;v4433"/a>        default:v4434"/a>                "a href="+code=BUG" class="sref">BUG"/a>();v4435"/a>                goto "a href="+code=err" class="sref">err"/a>;v4436"/a>        }v4437"/a>v4438"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a> = "a href="+code=devm_kzalloc" class="sref">devm_kzalloc"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>,v4439"/a>                                        sizeof(struct4"a href="+code=regulator_bulk_da2a" class="sref">regulator_bulk_da2a"/a>) *v4440"/a>                                        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>, "a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL"/a>);v4441"/a>        if (!"a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>) {v4442"/a>                "a href="+code=ret" class="sref">ret"/a> = -"a href="+code=ENOMEM" class="sref">ENOMEM"/a>;v4443"/a>                goto "a href="+code=err" class="sref">err"/a>;v4444"/a>        }v4445"/a>v4446"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4447"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4448"/a>                for ("a href="+code=i" class="sref">i"/a> = 0; "a href="+code=i" class="sref">i"/a> < "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm1811_main_supplies" class="sref">wm1811_main_supplies"/a>); "a href="+code=i" class="sref">i"/a>++)v4449"/a>                        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>["a href="+code=i" class="sref">i"/a>]."a href="+code=supply" class="sref">supply"/a> = "a href="+code=wm1811_main_supplies" class="sref">wm1811_main_supplies"/a>["a href="+code=i" class="sref">i"/a>];v4450"/a>                break;v4451"/a>        case "a href="+code=WM8994" class="sref">WM8994"/a>:v4452"/a>                for ("a href="+code=i" class="sref">i"/a> = 0; "a href="+code=i" class="sref">i"/a> < "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_main_supplies" class="sref">wm8994_main_supplies"/a>); "a href="+code=i" class="sref">i"/a>++)v4453"/a>                        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>["a href="+code=i" class="sref">i"/a>]."a href="+code=supply" class="sref">supply"/a> = "a href="+code=wm8994_main_supplies" class="sref">wm8994_main_supplies"/a>["a href="+code=i" class="sref">i"/a>];v4454"/a>                break;v4455"/a>        case "a href="+code=WM8958" class="sref">WM8958"/a>:v4456"/a>                for ("a href="+code=i" class="sref">i"/a> = 0; "a href="+code=i" class="sref">i"/a> < "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8958_main_supplies" class="sref">wm8958_main_supplies"/a>); "a href="+code=i" class="sref">i"/a>++)v4457"/a>                        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>["a href="+code=i" class="sref">i"/a>]."a href="+code=supply" class="sref">supply"/a> = "a href="+code=wm8958_main_supplies" class="sref">wm8958_main_supplies"/a>["a href="+code=i" class="sref">i"/a>];v4458"/a>                break;v4459"/a>        default:v4460"/a>                "a href="+code=BUG" class="sref">BUG"/a>();v4461"/a>                goto "a href="+code=err" class="sref">err"/a>;v4462"/a>        }v4463"/a>                v4464"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regulator_bulk_get" class="sref">regulator_bulk_get"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>,v4465"/a>                                 "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4466"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4467"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to get supplies: %d\n"ret"/a>);v4468"/a>                goto "a href="+code=err" class="sref">err"/a>;v4469"/a>        }v4470"/a>v4471"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regulator_bulk_enable" class="sref">regulator_bulk_enable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>,v4472"/a>                                    "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4473"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4474"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to enable supplies: %d\n"ret"/a>);v4475"/a>                goto "a href="+code=err_get" class="sref">err_get"/a>;v4476"/a>        }v4477"/a>v4478"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_SOFTWARE_RESET" class="sref">WM8994_SOFTWARE_RESET"/a>);v4479"/a>        if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4480"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read ID register\n"4481"/a>                goto "a href="+code=err_enable" class="sref">err_enable"/a>;v4482"/a>        }v4483"/a>        switch ("a href="+code=ret" class="sref">ret"/a>) {v4484"/a>        case 0x1811:v4485"/a>                "a href="+code=devnam3" class="sref">devnam3"/a> = "spa= class="string">"WM1811"4486"/a>                if ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> != "a href="+code=WM1811" class="sref">WM1811"/a>)v4487"/a>                        "a href="+code=dev_warn" class="sref">dev_warn"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Device registered as typ3 %d\n"4488"/a>                                 "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>);v4489"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> = "a href="+code=WM1811" class="sref">WM1811"/a>;v4490"/a>                break;v4491"/a>        case 0x8994:v4492"/a>                "a href="+code=devnam3" class="sref">devnam3"/a> = "spa= class="string">"WM8994"4493"/a>                if ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> != "a href="+code=WM8994" class="sref">WM8994"/a>)v4494"/a>                        "a href="+code=dev_warn" class="sref">dev_warn"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Device registered as typ3 %d\n"4495"/a>                                 "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>);v4496"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> = "a href="+code=WM8994" class="sref">WM8994"/a>;v4497"/a>                break;v4498"/a>        case 0x8958:v4499"/a>                "a href="+code=devnam3" class="sref">devnam3"/a> = "spa= class="string">"WM8958"4500"/a>                if ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> != "a href="+code=WM8958" class="sref">WM8958"/a>)v4501"/a>                        "a href="+code=dev_warn" class="sref">dev_warn"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Device registered as typ3 %d\n"4502"/a>                                 "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>);v4503"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> = "a href="+code=WM8958" class="sref">WM8958"/a>;v4504"/a>                break;v4505"/a>        default:v4506"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Device is not a WM8994, ID is %x\n"4507"/a>                        "a href="+code=ret" class="sref">ret"/a>);v4508"/a>                "a href="+code=ret" class="sref">ret"/a> = -"a href="+code=EINVAL" class="sref">EINVAL"/a>;v4509"/a>                goto "a href="+code=err_enable" class="sref">err_enable"/a>;v4510"/a>        }v4511"/a>v4512"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=wm8994_reg_read" class="sref">wm8994_reg_read"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_CHIP_REVISION" class="sref">WM8994_CHIP_REVISION"/a>);v4513"/a>        if ("a href="+code=ret" class="sref">ret"/a> < 0) {v4514"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to read revision register: %d\n"4515"/a>                        "a href="+code=ret" class="sref">ret"/a>);v4516"/a>                goto "a href="+code=err_enable" class="sref">err_enable"/a>;v4517"/a>        }v4518"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=revision" class="sref">revision"/a> = "a href="+code=ret" class="sref">ret"/a> & "a href="+code=WM8994_CHIP_REV_MASK" class="sref">WM8994_CHIP_REV_MASK"/a>;v4519"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=cust_id" class="sref">cust_id"/a> = ("a href="+code=ret" class="sref">ret"/a> & "a href="+code=WM8994_CUST_ID_MASK" class="sref">WM8994_CUST_ID_MASK"/a>) >> "a href="+code=WM8994_CUST_ID_SHIFT" class="sref">WM8994_CUST_ID_SHIFT"/a>;v4520"/a>v4521"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4522"/a>        case "a href="+code=WM8994" class="sref">WM8994"/a>:v4523"/a>                switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=revision" class="sref">revision"/a>) {v4524"/a>                case 0:v4525"/a>                case 1:v4526"/a>                        "a href="+code=dev_warn" class="sref">dev_warn"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>,v4527"/a>                                 "spa= class="string">"revision %c not fully supported\n"4528"/a>                                 "spa= class="string">'A'wm8994"/a>->"a href="+code=revision" class="sref">revision"/a>);v4529"/a>                        break;v4530"/a>                case 2:v4531"/a>                case 3:v4532"/a>                        "a href="+code=regmap_patch" class="sref">regmap_patch"/a> = "a href="+code=wm8994_revc_patch" class="sref">wm8994_revc_patch"/a>;v4533"/a>                        "a href="+code=patch_regs" class="sref">patch_regs"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_revc_patch" class="sref">wm8994_revc_patch"/a>);v4534"/a>                        break;v4535"/a>                default:v4536"/a>                        break;v4537"/a>                }v4538"/a>                break;v4539"/a>v4540"/a>        case "a href="+code=WM8958" class="sref">WM8958"/a>:v4541"/a>                switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=revision" class="sref">revision"/a>) {v4542"/a>                case 0:v4543"/a>                        "a href="+code=regmap_patch" class="sref">regmap_patch"/a> = "a href="+code=wm8958_reva_patch" class="sref">wm8958_reva_patch"/a>;v4544"/a>                        "a href="+code=patch_regs" class="sref">patch_regs"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8958_reva_patch" class="sref">wm8958_reva_patch"/a>);v4545"/a>                        break;v4546"/a>                default:v4547"/a>                        break;v4548"/a>                }v4549"/a>                break;v4550"/a>v4551"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4552"/a>                "spa= class="comment">/* Revision C did not change the relevant layer */"/spa="v4553"/a>                if ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=revision" class="sref">revision"/a> > 1)v4554"/a>                        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=revision" class="sref">revision"/a>++;v4555"/a>                switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=revision" class="sref">revision"/a>) {v4556"/a>                case 0:v4557"/a>                case 1:v4558"/a>                case 2:v4559"/a>                case 3:v4560"/a>                        "a href="+code=regmap_patch" class="sref">regmap_patch"/a> = "a href="+code=wm1811_reva_patch" class="sref">wm1811_reva_patch"/a>;v4561"/a>                        "a href="+code=patch_regs" class="sref">patch_regs"/a> = "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm1811_reva_patch" class="sref">wm1811_reva_patch"/a>);v4562"/a>                        break;v4563"/a>                default:v4564"/a>                        break;v4565"/a>                }v4566"/a>                break;v4567"/a>v4568"/a>        default:v4569"/a>                break;v4570"/a>        }v4571"/a>v4572"/a>        "a href="+code=dev_info" class="sref">dev_info"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"%s revision %c CUST_ID %02x\n"devnam3"/a>,v4573"/a>                 "spa= class="string">'A'wm8994"/a>->"a href="+code=revision" class="sref">revision"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=cust_id" class="sref">cust_id"/a>);v4574"/a>v4575"/a>        switch ("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>) {v4576"/a>        case "a href="+code=WM1811" class="sref">WM1811"/a>:v4577"/a>                "a href="+code=regmap_config" class="sref">regmap_config"/a> = &"a href="+code=wm1811_regmap_config" class="sref">wm1811_regmap_config"/a>;v4578"/a>                break;v4579"/a>        case "a href="+code=WM8994" class="sref">WM8994"/a>:v4580"/a>                "a href="+code=regmap_config" class="sref">regmap_config"/a> = &"a href="+code=wm8994_regmap_config" class="sref">wm8994_regmap_config"/a>;v4581"/a>                break;v4582"/a>        case "a href="+code=WM8958" class="sref">WM8958"/a>:v4583"/a>                "a href="+code=regmap_config" class="sref">regmap_config"/a> = &"a href="+code=wm8958_regmap_config" class="sref">wm8958_regmap_config"/a>;v4584"/a>                break;v4585"/a>        default:v4586"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Unknown device typ3 %d\n"wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a>);v4587"/a>                return -"a href="+code=EINVAL" class="sref">EINVAL"/a>;v4588"/a>        }v4589"/a>v4590"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regmap_reinit_cach3" class="sref">regmap_reinit_cach3"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=regmap_config" class="sref">regmap_config"/a>);v4591"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4592"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to reinit register cach3: %d\n"4593"/a>                        "a href="+code=ret" class="sref">ret"/a>);v4594"/a>                return "a href="+code=ret" class="sref">ret"/a>;v4595"/a>        }v4596"/a>v4597"/a>        if ("a href="+code=regmap_patch" class="sref">regmap_patch"/a>) {v4598"/a>                "a href="+code=ret" class="sref">ret"/a> = "a href="+code=regmap_register_patch" class="sref">regmap_register_patch"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>, "a href="+code=regmap_patch" class="sref">regmap_patch"/a>,v4599"/a>                                            "a href="+code=patch_regs" class="sref">patch_regs"/a>);v4600"/a>                if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4601"/a>                        "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to register patch: %d\n"4602"/a>                                "a href="+code=ret" class="sref">ret"/a>);v4603"/a>                        goto "a href="+code=err" class="sref">err"/a>;v4604"/a>                }v4605"/a>        }v4606"/a>v4607"/a>        if ("a href="+code=pda2a" class="sref">pda2a"/a>) {v4608"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=irq_bas3" class="sref">irq_bas3"/a> = "a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=irq_bas3" class="sref">irq_bas3"/a>;v4609"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=gpio_bas3" class="sref">gpio_bas3"/a> = "a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=gpio_bas3" class="sref">gpio_bas3"/a>;v4610"/a>v4611"/a>                "spa= class="comment">/* GPIO configuration is only applied if it's non-zero */"/spa="v4612"/a>                for ("a href="+code=i" class="sref">i"/a> = 0; "a href="+code=i" class="sref">i"/a> < "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=gpio_defaults" class="sref">gpio_defaults"/a>); "a href="+code=i" class="sref">i"/a>++) {v4613"/a>                        if ("a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=gpio_defaults" class="sref">gpio_defaults"/a>["a href="+code=i" class="sref">i"/a>]) {v4614"/a>                                "a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_GPIO_1" class="sref">WM8994_GPIO_1"/a> + "a href="+code=i" class="sref">i"/a>,v4615"/a>                                                0xffff,v4616"/a>                                                "a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=gpio_defaults" class="sref">gpio_defaults"/a>["a href="+code=i" class="sref">i"/a>]);v4617"/a>                        }v4618"/a>                }v4619"/a>v4620"/a>                "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=ldo_ena_always_driven" class="sref">ldo_ena_always_driven"/a> = "a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=ldo_ena_always_driven" class="sref">ldo_ena_always_driven"/a>;v4621"/a>v4622"/a>                if ("a href="+code=pda2a" class="sref">pda2a"/a>->"a href="+code=spkmode_pu" class="sref">spkmode_pu"/a>)v4623"/a>                        "a href="+code=pulls" class="sref">pulls"/a> |= "a href="+code=WM8994_SPKMODE_PU" class="sref">WM8994_SPKMODE_PU"/a>;v4624"/a>        }v4625"/a>v4626"/a>        "spa= class="comment">/* Disable unneeded pulls */"/spa="v4627"/a>        "a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_PULL_CONTROL_2" class="sref">WM8994_PULL_CONTROL_2"/a>,v4628"/a>                        "a href="+code=WM8994_LDO1ENA_PD" class="sref">WM8994_LDO1ENA_PD"/a> | "a href="+code=WM8994_LDO2ENA_PD" class="sref">WM8994_LDO2ENA_PD"/a> |v4629"/a>                        "a href="+code=WM8994_SPKMODE_PU" class="sref">WM8994_SPKMODE_PU"/a> | "a href="+code=WM8994_CSNADDR_PD" class="sref">WM8994_CSNADDR_PD"/a>,v4630"/a>                        "a href="+code=pulls" class="sref">pulls"/a>);v4631"/a>v4632"/a>        "spa= class="comment">/* In some system designs where the regulators are not in use,"/spa="v4633"/a>"spa= class="comment">         * we ca= achieve a small reduction in leakage currents by"/spa="v4634"/a>"spa= class="comment">         * floating LDO outputs.  This bit makes no difference if the"/spa="v4635"/a>"spa= class="comment">         * LDOs are enabled, it only affects cases where the LDOs were"/spa="v4636"/a>"spa= class="comment">         * in operation and are then disabled."/spa="v4637"/a>"spa= class="comment">         */"/spa="v4638"/a>        for ("a href="+code=i" class="sref">i"/a> = 0; "a href="+code=i" class="sref">i"/a> < "a href="+code=WM8994_NUM_LDO_REGS" class="sref">WM8994_NUM_LDO_REGS"/a>; "a href="+code=i" class="sref">i"/a>++) {v4639"/a>                if ("a href="+code=wm8994_ldo_in_us3" class="sref">wm8994_ldo_in_us3"/a>("a href="+code=pda2a" class="sref">pda2a"/a>, "a href="+code=i" class="sref">i"/a>))v4640"/a>                        "a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_LDO_1" class="sref">WM8994_LDO_1"/a> + "a href="+code=i" class="sref">i"/a>,v4641"/a>                                        "a href="+code=WM8994_LDO1_DISCH" class="sref">WM8994_LDO1_DISCH"/a>, "a href="+code=WM8994_LDO1_DISCH" class="sref">WM8994_LDO1_DISCH"/a>);v4642"/a>                elsev4643"/a>                        "a href="+code=wm8994_set_bits" class="sref">wm8994_set_bits"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=WM8994_LDO_1" class="sref">WM8994_LDO_1"/a> + "a href="+code=i" class="sref">i"/a>,v4644"/a>                                        "a href="+code=WM8994_LDO1_DISCH" class="sref">WM8994_LDO1_DISCH"/a>, 0);v4645"/a>        }v4646"/a>v4647"/a>        "a href="+code=wm8994_irq_init" class="sref">wm8994_irq_init"/a>("a href="+code=wm8994" class="sref">wm8994"/a>);v4648"/a>v4649"/a>        "a href="+code=ret" class="sref">ret"/a> = "a href="+code=mfd_add_devices" class="sref">mfd_add_devices"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, -1,v4650"/a>                              "a href="+code=wm8994_devs" class="sref">wm8994_devs"/a>, "a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE"/a>("a href="+code=wm8994_devs" class="sref">wm8994_devs"/a>),v4651"/a>                              "a href="+code=NULL" class="sref">NULL"/a>, 0, "a href="+code=NULL" class="sref">NULL"/a>);v4652"/a>        if ("a href="+code=ret" class="sref">ret"/a> != 0) {v4653"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to add children: %d\n"ret"/a>);v4654"/a>                goto "a href="+code=err_irq" class="sref">err_irq"/a>;v4655"/a>        }v4656"/a>v4657"/a>        "a href="+code=pm_runtime_enable" class="sref">pm_runtime_enable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>);v4658"/a>        "a href="+code=pm_runtime_idle" class="sref">pm_runtime_idle"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>);v4659"/a>v4660"/a>        return 0;v4661"/a>v4662"/a>"a href="+code=err_irq" class="sref">err_irq"/a>:v4663"/a>        "a href="+code=wm8994_irq_exit" class="sref">wm8994_irq_exit"/a>("a href="+code=wm8994" class="sref">wm8994"/a>);v4664"/a>"a href="+code=err_enable" class="sref">err_enable"/a>:v4665"/a>        "a href="+code=regulator_bulk_disable" class="sref">regulator_bulk_disable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>,v4666"/a>                               "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4667"/a>"a href="+code=err_get" class="sref">err_get"/a>:v4668"/a>        "a href="+code=regulator_bulk_free" class="sref">regulator_bulk_free"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4669"/a>"a href="+code=err" class="sref">err"/a>:v4670"/a>        "a href="+code=mfd_remove_devices" class="sref">mfd_remove_devices"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>);v4671"/a>        return "a href="+code=ret" class="sref">ret"/a>;v4672"/a>}v4673"/a>v4674"/a>static "a href="+code=__devexit" class="sref">__devexit"/a> void "a href="+code=wm8994_device_exit" class="sref">wm8994_device_exit"/a>(struct "a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>)v4675"/a>{v4676"/a>        "a href="+code=pm_runtime_disable" class="sref">pm_runtime_disable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>);v4677"/a>        "a href="+code=mfd_remove_devices" class="sref">mfd_remove_devices"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>);v4678"/a>        "a href="+code=wm8994_irq_exit" class="sref">wm8994_irq_exit"/a>("a href="+code=wm8994" class="sref">wm8994"/a>);v4679"/a>        "a href="+code=regulator_bulk_disable" class="sref">regulator_bulk_disable"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>,v4680"/a>                               "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4681"/a>        "a href="+code=regulator_bulk_free" class="sref">regulator_bulk_free"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=num_supplies" class="sref">num_supplies"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=supplies" class="sref">supplies"/a>);v4682"/a>}v4683"/a>v4684"/a>static const struct "a href="+code=of_device_id" class="sref">of_device_id"/a> "a href="+code=wm8994_of_match" class="sref">wm8994_of_match"/a>[] = {v4685"/a>        { ."a href="+code=compatible" class="sref">compatible"/a> = "spa= class="string">"wlf,wm1811"4686"/a>        { ."a href="+code=compatible" class="sref">compatible"/a> = "spa= class="string">"wlf,wm8994"4687"/a>        { ."a href="+code=compatible" class="sref">compatible"/a> = "spa= class="string">"wlf,wm8958"4688"/a>        { }v4689"/a>};v4690"/a>"a href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLE"/a>("a href="+code=of" class="sref">of"/a>, "a href="+code=wm8994_of_match" class="sref">wm8994_of_match"/a>);v4691"/a>v4692"/a>static "a href="+code=__devinit" class="sref">__devinit"/a> int "a href="+code=wm8994_i2c_prob3" class="sref">wm8994_i2c_prob3"/a>(struct "a href="+code=i2c_client" class="sref">i2c_client"/a> *"a href="+code=i2c" class="sref">i2c"/a>,v4693"/a>                                      const struct "a href="+code=i2c_device_id" class="sref">i2c_device_id"/a> *"a href="+code=id" class="sref">id"/a>)v4694"/a>{v4695"/a>        struct "a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a>;v4696"/a>        int "a href="+code=ret" class="sref">ret"/a>;v4697"/a>v4698"/a>        "a href="+code=wm8994" class="sref">wm8994"/a> = "a href="+code=devm_kzalloc" class="sref">devm_kzalloc"/a>(&"a href="+code=i2c" class="sref">i2c"/a>->"a href="+code=dev" class="sref">dev"/a>, sizeof(struct "a href="+code=wm8994" class="sref">wm8994"/a>), "a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL"/a>);v4699"/a>        if ("a href="+code=wm8994" class="sref">wm8994"/a> == "a href="+code=NULL" class="sref">NULL"/a>)v4700"/a>                return -"a href="+code=ENOMEM" class="sref">ENOMEM"/a>;v4701"/a>v4702"/a>        "a href="+code=i2c_set_clientda2a" class="sref">i2c_set_clientda2a"/a>("a href="+code=i2c" class="sref">i2c"/a>, "a href="+code=wm8994" class="sref">wm8994"/a>);v4703"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a> = &"a href="+code=i2c" class="sref">i2c"/a>->"a href="+code=dev" class="sref">dev"/a>;v4704"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=irq" class="sref">irq"/a> = "a href="+code=i2c" class="sref">i2c"/a>->"a href="+code=irq" class="sref">irq"/a>;v4705"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=typ3" class="sref">typ3"/a> = "a href="+code=id" class="sref">id"/a>->"a href="+code=driver_da2a" class="sref">driver_da2a"/a>;v4706"/a>v4707"/a>        "a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a> = "a href="+code=devm_regmap_init_i2c" class="sref">devm_regmap_init_i2c"/a>("a href="+code=i2c" class="sref">i2c"/a>, &"a href="+code=wm8994_bas3_regmap_config" class="sref">wm8994_bas3_regmap_config"/a>);v4708"/a>        if ("a href="+code=IS_ERR" class="sref">IS_ERR"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>)) {v4709"/a>                "a href="+code=ret" class="sref">ret"/a> = "a href="+code=PTR_ERR" class="sref">PTR_ERR"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=regmap" class="sref">regmap"/a>);v4710"/a>                "a href="+code=dev_err" class="sref">dev_err"/a>("a href="+code=wm8994" class="sref">wm8994"/a>->"a href="+code=dev" class="sref">dev"/a>, "spa= class="string">"Failed to allocate register map: %d\n"4711"/a>                        "a href="+code=ret" class="sref">ret"/a>);v4712"/a>                return "a href="+code=ret" class="sref">ret"/a>;v4713"/a>        }v4714"/a>v4715"/a>        return "a href="+code=wm8994_device_init" class="sref">wm8994_device_init"/a>("a href="+code=wm8994" class="sref">wm8994"/a>, "a href="+code=i2c" class="sref">i2c"/a>->"a href="+code=irq" class="sref">irq"/a>);v4716"/a>}v4717"/a>v4718"/a>static "a href="+code=__devexit" class="sref">__devexit"/a> int "a href="+code=wm8994_i2c_remove" class="sref">wm8994_i2c_remove"/a>(struct "a href="+code=i2c_client" class="sref">i2c_client"/a> *"a href="+code=i2c" class="sref">i2c"/a>)v4719"/a>{v4720"/a>        struct "a href="+code=wm8994" class="sref">wm8994"/a> *"a href="+code=wm8994" class="sref">wm8994"/a> = "a href="+code=i2c_get_clientda2a" class="sref">i2c_get_clientda2a"/a>("a href="+code=i2c" class="sref">i2c"/a>);v4721"/a>v4722"/a>        "a href="+code=wm8994_device_exit" class="sref">wm8994_device_exit"/a>("a href="+code=wm8994" class="sref">wm8994"/a>);v4723"/a>v4724"/a>        return 0;v4725"/a>}v4726"/a>v4727"/a>static const struct "a href="+code=i2c_device_id" class="sref">i2c_device_id"/a> "a href="+code=wm8994_i2c_id" class="sref">wm8994_i2c_id"/a>[] = {v4728"/a>        { "spa= class="string">"wm1811"WM1811"/a> },v4729"/a>        { "spa= class="string">"wm1811a"WM1811"/a> },v4730"/a>        { "spa= class="string">"wm8994"WM8994"/a> },v4731"/a>        { "spa= class="string">"wm8958"WM8958"/a> },v4732"/a>        { }v4733"/a>};v4734"/a>"a href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLE"/a>("a href="+code=i2c" class="sref">i2c"/a>, "a href="+code=wm8994_i2c_id" class="sref">wm8994_i2c_id"/a>);v4735"/a>v4736"/a>static "a href="+code=UNIVERSAL_DEV_PM_OPS" class="sref">UNIVERSAL_DEV_PM_OPS"/a>("a href="+code=wm8994_pm_ops" class="sref">wm8994_pm_ops"/a>, "a href="+code=wm8994_suspend" class="sref">wm8994_suspend"/a>, "a href="+code=wm8994_resum3" class="sref">wm8994_resum3"/a>,v4737"/a>                            "a href="+code=NULL" class="sref">NULL"/a>);v4738"/a>v4739"/a>static struct "a href="+code=i2c_driver" class="sref">i2c_driver"/a> "a href="+code=wm8994_i2c_driver" class="sref">wm8994_i2c_driver"/a> = {v4740"/a>        ."a href="+code=driver" class="sref">driver"/a> = {v4741"/a>                ."a href="+code=nam3" class="sref">nam3"/a> = "spa= class="string">"wm8994"4742"/a>                ."a href="+code=owner" class="sref">owner"/a> = "a href="+code=THIS_MODULE" class="sref">THIS_MODULE"/a>,v4743"/a>                ."a href="+code=pm" class="sref">pm"/a> = &"a href="+code=wm8994_pm_ops" class="sref">wm8994_pm_ops"/a>,v4744"/a>                ."a href="+code=of_match_table" class="sref">of_match_table"/a> = "a href="+code=wm8994_of_match" class="sref">wm8994_of_match"/a>,v4745"/a>        },v4746"/a>        ."a href="+code=prob3" class="sref">prob3"/a> = "a href="+code=wm8994_i2c_prob3" class="sref">wm8994_i2c_prob3"/a>,v4747"/a>        ."a href="+code=remove" class="sref">remove"/a> = "a href="+code=__devexit_p" class="sref">__devexit_p"/a>("a href="+code=wm8994_i2c_remove" class="sref">wm8994_i2c_remove"/a>),v4748"/a>        ."a href="+code=id_table" class="sref">id_table"/a> = "a href="+code=wm8994_i2c_id" class="sref">wm8994_i2c_id"/a>,v4749"/a>};v4750"/a>v4751"/a>"a href="+code=module_i2c_driver" class="sref">module_i2c_driver"/a>("a href="+code=wm8994_i2c_driver" class="sref">wm8994_i2c_driver"/a>);v4752"/a>v4753"/a>"a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION"/a>("spa= class="string">"Core support for the WM8994 audio CODEC"4754"/a>"a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE"/a>("spa= class="string">"GPL"4755"/a>"a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR"/a>("spa= class="string">"Mark Brown <broonie@opensource.wolfsonmicro.com>"4756"/a>
lxr.linux.no kindly hosted by Redpill Linpro AS"/a>, provider of Linux consulting and operations services since 1995.