linux/drivers/mfd/wm8400-core.c
<<
>>
Prefs
   1/*
   2 * Core driver for WM8400.
   3 *
   4 * Copyright 2008 Wolfson Microelectronics PLC.
   5 *
   6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
   7 *
   8 * This program is free software; you can redistribute it and/or
   9 * modify it under the terms of the GNU General Public License as
  10 * published by the Free Software Foundation; either version 2 of the
  11 * License, or (at your option) any later version.
  12 *
  13 */
  14
  15#include <linux/module.h>
  16#include <linux/bug.h>
  17#include <linux/err.h>
  18#include <linux/i2c.h>
  19#include <linux/kernel.h>
  20#include <linux/mfd/core.h>
  21#include <linux/mfd/wm8400-private.h>
  22#include <linux/mfd/wm8400-audio.h>
  23#include <linux/regmap.h>
  24#include <linux/slab.h>
  25
  26static bool wm8400_volatile(struct device *dev, unsigned int reg)
  27{
  28        switch (reg) {
  29        case WM8400_INTERRUPT_STATUS_1:
  30        case WM8400_INTERRUPT_LEVELS:
  31        case WM8400_SHUTDOWN_REASON:
  32                return true;
  33        default:
  34                return false;
  35        }
  36}
  37
  38/**
  39 * wm8400_="L_="ad "line" 8inglern gisersi"linn>
 430 * publn>
 431 * Licen@0-core: Poa he teo00_="L_ nts"rol t 
 432 * Core @n g:

 433 *
   34 * Copyr@n 
n>
 435 *
 436falseu>#inclref="+code=wm8400_volat"ad "linss="sref">wm8400_volat"ad "linstruct wm8400_vola*wm8400_vola*falseu8inclref="+code=wm840class="sref">reg)
 437 438reg 439regt
 530 531regt
wm840clawm8400_vola*wm840clareg)
reg 532regt
 533regt
  534   35reg 536 537regwm8400_volat"ad "linstru)href="drivers/mfd/wm8400-core.c#L35" i5="L38" c5ass="line" name="L38"> 538 539wm8400_volatblock "linstruct wm8400_vola*wm8400_vola*falseu8inclref="+code=wm840class="sref">reg)
regfalseu>#inclrref="+code=dev" catass="sref">dev 630 631wm840clawm8400_vola*wm840clareg)
devreg 632 633regwm8400_volatblock "linstru)href="drivers/mfd/wm8400-core.c#L35" i6="L4" cl6ass="line" name="L4">  634  635wm8400_volat"adisers_reg"cstruct wm8400_vola*wm8400_vola*   36 637regreg 638reg"0-core.c#g"c"n>
 639devwm8400_vola* 730regwm8400_vola* 731 732 733reg sstrucef="+code=dev" 0_volass="sref">wm8400_vola*dev, unsig-1, &anf="+code=wm840cel"ss="sref">regregreg  734  735  736 * Aupan>
   37 *
 738 * Thisn>
 739 * wm840The00. .fs
	ob
n>
 830 * publifun="ajasWM840each bus set upFree ac> ssorsFreess=allra ho ;">
 ton>
 831 * Licenset upFree e  itselfan>
 832 * Corean>
 833wm8400_volata itstruct wm8400_vola*wm8400_vola*  834devdev  835  836reg)
  837regt
   38 839devwm8400_vola*dev, unsigef="+code=dev" 0_volass="sref">wm8400_vola* 930 931 * Aupa CheckFreat ;">
 >
 actually a00.
 932regt
wm840clawm8400_vola*wm840clawm8400_SHUTDRESET_ID
reg)
 933regt
  934devwm8400_vola*dev, unsigeclass="commeute ng">"Chip IDrn gisersi"lin failed\n"n>
  935reg  936  937reg)
  938devwm8400_vola*dev, unsigeclass="commeute ng">"D  is not a00.
   39reg)
  130reg  010  020  030regt
wm840clawm8400_vola*wm840clawm8400_SHUTDID
reg)
  040regt
  050devwm8400_vola*dev, unsigeclass="commeute ng">"IDrn gisersi"lin failed: %d\n"n>
regt
  060regt
  070  080reg)
reg)
wm8400_SHUTDCHIPDREV_MASK
wm8400_SHUTDCHIPDREV_SHIFT
  090devwm8400_vola*dev, unsigeclass="commeute ng">"0.
reg)
   10  110regt
wm8400_volat"adisers_reg"cstrucef="+code=dev" 0_volass="sref">wm8400_vola*   12regt
   13devwm8400_vola*dev, unsigeclass="commeute ng">"Failedieo0"lgisersireg"c\n"n>
   14dev   15   16#inclref="drivers/mfd/wm8400-core.c#L36" i1d="L17" cllass="line" name="L17">   17devdevwm840plat

  _a it
   18regt
devwm840plat

  _a it
wm8400_vola*dev, unshhref="drivers/mfd/wm8400-core.c#L35" i1d="L19" cllass="line" name="L19">   19regt
 1 20devwm8400_vola*dev, unsigeclass="commeute ng">"Plat

  ra it failed: %d\n"n>
 1 21regt
  112dev 1 23 1 24 1 25devwm8400_vola*dev, unsigeclass="commeute ng">"No plat

  ra itialis; eit supplied\n"n>
 1 26 1 27 1 28 1 29     nf="+code=wm840err_childrame=="sref">dev 1 30        case nf="+code=wm840m84_remove_e sss="sref">reg s
wm8400_vola*dev, unshhref="drivers/mfd/wm8400-core.c#L35" i1d="L31" c1lass="line" name="L31"> 1 31regt
 1 32  123     ref="drivers/mfd/wm8400-core.c#L37" i13="L24" c1lass="line" name="L34"> 1 34     c false0_volatn leala
wm8400_vola*wm8400_vola* 1 35 1 36 sss="sref">reg s
wm8400_vola*dev, unshhref="drivers/mfd/wm8400-core.c#L35" i1d="L27" c1lass="line" name="L37"> 1 37
 1 38 1 39wm840clawm8400_volatn g 1430reg 1431reg 1432regwm8400_SHUTDREGISTER_COUNT
 1433  1 34(_class="sref">reg(_cla
wm8400_volatile(stru,ref="drivers/mfd/wm8400-core.c#L29" i1=="L35" c14ass="line" name="L35"> 1435 1436wm840cache_"hid
wm840REGCACHE_RBTREEstru,ref="drivers/mfd/wm8400-core.c#L29" i1=="L27" c14ass="line" name="L37"> 1437 1438 1439 * wmspan>
 1530 * publi0_volatn set_reg"ct"ad cache - R set cachedireg"c0"lgisers
 ton>
 1531 * Licentheirult:

san>
 1532 * Corean>
 1533wm8400_volatn set_reg"ct"ad cache
wm8400_vola*wm8400_vola*  1534  1 35wm840clawm8400_vola*wm840clawm8400_volatn g 1536 1537regwm8400_volatn set_reg"ct"ad cache
 1538 1539wm840clfnamnstrucef="+code=dev" CONFIG_I2Css="sref">wm840CONFIG_I2C
wm840clfnamnstrucef="+code=dev" CONFIG_I2C_MODULEss="sref">wm840CONFIG_I2C_MODULE* 1630wm8400_volata2c_p	ob

regreg 1631 _inss="sref">wm840a2c_e _in*wm840ad* 1632 1633wm8400_vola*wm8400_vola*  1634regt
  1635  1 36wm8400_vola*regregdev, unsigsiz8of(t wm8400_vola*reg 1637wm8400_vola*reg 1638regt
reg 1639dev 1730 1731 1732wm8400_vola*wm840claregregwm8400_volatn g 1733wm840IS_ERRstrucef="+code=dev" 0_volass="sref">wm8400_vola*wm840cla  1734regt
wm840PTR_ERRstrucef="+code=dev" 0_volass="sref">wm8400_vola*wm840cla  1735dev  1736  1 37 1738wm8400_vola*dev, uns =r&anf="+code=wm840a2css="sref">regdev, unshref="drivers/mfd/wm8400-core.c#L35" i1=="L39" c17ass="line" name="L39"> 1739devregwm8400_vola* 1830 1831regt
wm8400_volata itstrucef="+code=devic0_volass="sref">wm8400_vola*regdev, uns.ef="+code=wm840plat

  _catass="sref">dev 1832regt
 1833dev  1834  1835  1836  1837dev  1 38regt
 1839 1930 1931wm8400_volata2c_remove
regreg 1932 1933wm8400_vola*wm8400_vola*devreg  1934  1935false0_volatn leala
wm8400_vola*  1936  1937  1938  139 2130 _inss="sref">wm840a2c_e _in*wm8400_volata2c_in* 2010"0-core"n>
 2020 2030 2040wm840MODULE_DEVICE_TABLEstrucef="+code=dev" a2css="sref">regwm8400_volata2c_in* 2050 2060wm840a2c_es/mfd*wm8400_volata2c_es/mfd* 2070wm840es/mfd* 2080reg"0_SHUT"n>
 2090wm840ownfd*wm840THIS_MODULEstru,ref="drivers/mfd/wm8400-core.c#L29" i2d="L10" c2lass="line" name="L10"> 2 10  210wm840p	ob

wm8400_volata2c_p	ob

 2 12wm840remove
wm8400_volata2c_remove
 2 13wm840id_tabla
wm8400_volata2c_in* 2 14 2 15 2 16#inclref="drivers/mfd/wm8400-core.c#L36" i2d="L17" c2lass="line" name="L17"> 2 17wm840_ta itstruref="+code=wm8400_volatmoduleta itss="sref">wm8400_volatmoduleta itstrucvoidhref="drivers/mfd/wm8400-core.c#L27" idd="L18" c2lass="line" name="L18"> 2 18 2 19regt
reg 2 20 2 21wm840clfnamnstrucef="+code=dev" CONFIG_I2Css="sref">wm840CONFIG_I2C
wm840clfnamnstrucef="+code=dev" CONFIG_I2C_MODULEss="sref">wm840CONFIG_I2C_MODULE* 2112regt
wm840a2c_add_es/mfdstruc&anf="+code=wm8400_volata2c_es/mfdss="sref">wm8400_volata2c_es/mfd* 2 23regt
 2 24dev"Failedieo0"lgisersiI2Cars/mfd: %d\n"n>
regt
 2 25 2 26 2 27regt
 2 28 2 29     nf="+code=wm840subsysta it=allss="sref">regwm8400_volatmoduleta itstruhhref="drivers/mfd/wm8400-core.c#L35" i2d="L30" c2lass="line" name="L30"> 2 30 2 31wm840_texitstruref="+code=wm8400_volatmoduletexitss="sref">wm8400_volatmoduletexitstrucvoidhref="drivers/mfd/wm8400-core.c#L27" idd="L32" c2lass="line" name="L32"> 2 32 2123     udfrnf="+code=wm840clfnamnss="sref">wm840clfnamnstrucef="+code=dev" CONFIG_I2Css="sref">wm840CONFIG_I2C
wm840clfnamnstrucef="+code=dev" CONFIG_I2C_MODULEss="sref">wm840CONFIG_I2C_MODULE* 2 34wm840a2c_ewm8400_volata2c_es/mfd* 2 35 2 36 2 37wm840moduletexitstrucef="+code=wm8400_volatmoduletexitss="sref">wm8400_volatmoduletexitstru)href="drivers/mfd/wm8400-core.c#L18" i2d="L18" c2lass="line" name="L38"> 2 38 2 39wm840MODULE_LICENSEstruceclass="commeute ng">"GPL"n>
 2430wm840MODULE_AUTHORstruceclass="commeute ng">"Mark Brown a hrbroonie@opensource.wolfsonmicro.comgt;">quot;n>
 2431


The0original LXR software byFree ef="drivehttp://sourceforge.net/projects/lxss>LXR nt">u itystru,r;"> experi> * al mfd/eit byFef="drivemailto:lxs@ naux.no">lxs@ naux.no uns.
lxs. naux.no kindly hoserd byFef="drivehttp://www.redpill- napro.no">Redpill Lnapro ASstru,rprovidrsiof Lnauxrconsult ng and opera"ajasWser/a> s since/1995.