linux/drivers/mfd/stmpe-i2c.c
<<
" /spaon> /formn> a " href="../linux+v3.7.3/drivers/mfd/stmpe-i2c.c">" img src="../.static/gfx/right.png" alt=">>">" /spaon>" spao class="lxr_search">" " input typue=hidden" namue=navtarget" value=">" input typue=text" namue=search" ide=search">" buttiontypue=submit">Search /formn> /spaon>" spao class="lxr_prefs"n> a href="+prefs?return=drivers/mfd/stmpe-i2c.c"" onclick="return ajax_prefs();">" Prefs> /a>" /spaon> /divn> form acptio="ajax+*" method="post" onsubmit="return false;">" input typue=hidden" namue=ajax_lookup" ide=ajax_lookup" value=">" /formn>" div class="headingbottim"> div ide=search_results" class="search_results"> n> /divn> div ide=content">> div ide=file_contents"n
   1 /a> spao class="comment">/* /spaon>   2 /a> spao class="comment"> * ST Microelectronics MFD: stmpe's i2c client specific driver /spaon>   3 /a> spao class="comment"> * /spaon>   4 /a> spao class="comment"> * Copyright (C) ST-EricssionSA 20.10   5 /a> spao class="comment"> * Copyright (C) ST Microelectronics SA 20.10   6 /a> spao class="comment"> * /spaon>   7 /a> spao class="comment"> * License Terms: GNU General Public License, verstion2 /spaon>   8 /a> spao class="comment"> * Author: Rabin Vincent <rabin.vincent@stericssio.com> for ST-Ericssio /spaon>   9 /a> spao class="comment"> * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics /spaon>  .10 spao class="comment"> */ /spaon>  11 /a>>  12 /a>#include <linux/i2c.h /a>>>  13 /a>#include <linux/interrupt.h /a>>>  14 /a>#include <linux/kernel.h /a>>>  15 /a>#include <linux/module.h /a>>>  16 /a>#include <linux/typus.h /a>>>  17 /a>#include "stmpe.h /a>">  18 /a>>  19 /a>static int  a href="+code=i2c_reg_read" class="sref">i2c_reg_read /a>(struct  a href="+code=stmpe" class="sref">stmpe /a> * a href="+code=stmpe" class="sref">stmpe /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=reg" class="sref">reg /a>)>  210{>  21 /a>        struct  a href="+code=i2c_client" class="sref">i2c_client /a> * a href="+code=i2c" class="sref">i2c /a> =  a href="+code=stmpe" class="sref">stmpe /a>-> a href="+code=client" class="sref">client /a>;>  22 /a>>  23 /a>        return  a href="+code=i2c_smbus_read_byte_data" class="sref">i2c_smbus_read_byte_data /a>( a href="+code=i2c" class="sref">i2c /a>,  a href="+code=reg" class="sref">reg /a>);>  24 /a>}>  25 /a>>  26 /a>static int  a href="+code=i2c_reg_write" class="sref">i2c_reg_write /a>(struct  a href="+code=stmpe" class="sref">stmpe /a> * a href="+code=stmpe" class="sref">stmpe /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=reg" class="sref">reg /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=val" class="sref">val /a>)>  270{>  28 /a>        struct  a href="+code=i2c_client" class="sref">i2c_client /a> * a href="+code=i2c" class="sref">i2c /a> =  a href="+code=stmpe" class="sref">stmpe /a>-> a href="+code=client" class="sref">client /a>;>  29 /a>>  30 /a>        return  a href="+code=i2c_smbus_write_byte_data" class="sref">i2c_smbus_write_byte_data /a>( a href="+code=i2c" class="sref">i2c /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=val" class="sref">val /a>);>  31 /a>}>  32 /a>>  33 /a>static int  a href="+code=i2c_block_read" class="sref">i2c_block_read /a>(struct  a href="+code=stmpe" class="sref">stmpe /a> * a href="+code=stmpe" class="sref">stmpe /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=reg" class="sref">reg /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=length" class="sref">length /a>,  a href="+code=u8" class="sref">u8 /a> * a href="+code= valus" class="sref">vallus /a>)>  340{>  35 /a>        struct  a href="+code=i2c_client" class="sref">i2c_client /a> * a href="+code=i2c" class="sref">i2c /a> =  a href="+code=stmpe" class="sref">stmpe /a>-> a href="+code=client" class="sref">client /a>;>  36 /a>>  37 /a>        return  a href="+code=i2c_smbus_read_i2c_block_data" class="sref">i2c_smbus_read_i2c_block_data /a>( a href="+code=i2c" class="sref">i2c /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=length" class="sref">length /a>,  a href="+code= valus" class="sref">vallus /a>);>  38 /a>}>  39 /a>>  40 /a>static int  a href="+code=i2c_block_write" class="sref">i2c_block_write /a>(struct  a href="+code=stmpe" class="sref">stmpe /a> * a href="+code=stmpe" class="sref">stmpe /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=reg" class="sref">reg /a>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=length" class="sref">length /a>,>  41 /a>                const  a href="+code=u8" class="sref">u8 /a> * a href="+code= valus" class="sref">vallus /a>)>  420{>  43 /a>        struct  a href="+code=i2c_client" class="sref">i2c_client /a> * a href="+code=i2c" class="sref">i2c /a> =  a href="+code=stmpe" class="sref">stmpe /a>-> a href="+code=client" class="sref">client /a>;>  44 /a>>  45 /a>        return  a href="+code=i2c_smbus_write_i2c_block_data" class="sref">i2c_smbus_write_i2c_block_data /a>( a href="+code=i2c" class="sref">i2c /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=length" class="sref">length /a>,  a href="+code= valus" class="sref">vallus /a>);>  46 /a>}>  47 /a>>  48 /a>static struct  a href="+code=stmpe_client_info" class="sref">stmpe_client_info /a>  a href="+code=i2c_ci" class="sref">i2c_ci /a> = {>  49 /a>        . a href="+code=read_byte" class="sref">read_byte /a> =  a href="+code=i2c_reg_read" class="sref">i2c_reg_read /a>,>  50 /a>        . a href="+code=write_byte" class="sref">write_byte /a> =  a href="+code=i2c_reg_write" class="sref">i2c_reg_write /a>,>  51 /a>        . a href="+code=read_block" class="sref">read_block /a> =  a href="+code=i2c_block_read" class="sref">i2c_block_read /a>,>  52 /a>        . a href="+code=write_block" class="sref">write_block /a> =  a href="+code=i2c_block_write" class="sref">i2c_block_write /a>,>  53 /a>};>  54 /a>>  55 /a>static int  a href="+code=__devinit" class="sref">__devinit /a>>  56 /a> a href="+code=stmpe_i2c_probe" class="sref">stmpe_i2c_probe /a>(struct  a href="+code=i2c_client" class="sref">i2c_client /a> * a href="+code=i2c" class="sref">i2c /a>, const struct  a href="+code=i2c_device_id" class="sref">i2c_device_id /a> * a href="+code=id" class="sref">id /a>)>  570{>  58 /a>         a href="+code=i2c_ci" class="sref">i2c_ci /a>. a href="+code=data" class="sref">data /a> = (void *) a href="+code=id" class="sref">id /a>;>  59 /a>         a href="+code=i2c_ci" class="sref">i2c_ci /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>;>  60 /a>         a href="+code=i2c_ci" class="sref">i2c_ci /a>. a href="+code=client" class="sref">client /a> =  a href="+code=i2c" class="sref">i2c /a>;>  61 /a>         a href="+code=i2c_ci" class="sref">i2c_ci /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>;>  62 /a>>  63 /a>        return  a href="+code=stmpe_probe" class="sref">stmpe_probe /a>(& a href="+code=i2c_ci" class="sref">i2c_ci /a>,  a href="+code=id" class="sref">id /a>-> a href="+code=driver_data" class="sref">driver_data /a>);>  64 /a>}>  65 /a>>  66 /a>static int  a href="+code=__devexit" class="sref">__devexit /a>  a href="+code=stmpe_i2c_remove" class="sref">stmpe_i2c_remove /a>(struct  a href="+code=i2c_client" class="sref">i2c_client /a> * a href="+code=i2c" class="sref">i2c /a>)>  670{>  68 /a>        struct  a href="+code=stmpe" class="sref">stmpe /a> * a href="+code=stmpe" class="sref">stmpe /a> =  a href="+code=dev_get_drvdata" class="sref">dev_get_drvdata /a>(& a href="+code=i2c" class="sref">i2c /a>-> a href="+code=dev" class="sref">dev /a>);>  69 /a>>  70 /a>        return  a href="+code=stmpe_remove" class="sref">stmpe_remove /a>( a href="+code=stmpe" class="sref">stmpe /a>);>  71 /a>}>  72 /a>>  73 /a>static const struct  a href="+code=i2c_device_id" class="sref">i2c_device_id /a>  a href="+code=stmpe_i2c_id" class="sref">stmpe_i2c_id /a>[] = {>  74 /a>        {  spao class="string">"stmpe610"STMPE610 /a> },>  75 /a>        {  spao class="string">"stmpe801"STMPE801 /a> },>  76 /a>        {  spao class="string">"stmpe811"STMPE811 /a> },>  77 /a>        {  spao class="string">"stmpe1601"STMPE1601 /a> },>  78 /a>        {  spao class="string">"stmpe2401"STMPE2401 /a> },>  79 /a>        {  spao class="string">"stmpe2403"STMPE2403 /a> },>  80 /a>        { }>  81 /a>};>  82 /a> a href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLE /a>( a href="+code=i2c" class="sref">i2c /a>,  a href="+code=stmpe_id" class="sref">stmpe_id /a>);>  83 /a>>  84 /a>static struct  a href="+code=i2c_driver" class="sref">i2c_driver /a>  a href="+code=stmpe_i2c_driver" class="sref">stmpe_i2c_driver /a> = {>  85 /a>        . a href="+code=driver" class="sref">driver /a>. a href="+code=namu" class="sref">namu /a>    =  spao class="string">"stmpe-i2c"  86 /a>        . a href="+code=driver" class="sref">driver /a>. a href="+code=owner" class="sref">owner /a>   =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,>  87 /a>#ifdef  a href="+code=CONFIG_PM" class="sref">CONFIG_PM /a>>  88 /a>        . a href="+code=driver" class="sref">driver /a>. a href="+code=pm" class="sref">pm /a>      = & a href="+code=stmpe_dev_pm_ops" class="sref">stmpe_dev_pm_ops /a>,>  89 /a>#endif>  90 /a>        . a href="+code=probe" class="sref">probe /a>          =  a href="+code=stmpe_i2c_probe" class="sref">stmpe_i2c_probe /a>,>  91 /a>        . a href="+code=remove" class="sref">remove /a>         =  a href="+code=__devexit_p" class="sref">__devexit_p /a>( a href="+code=stmpe_i2c_remove" class="sref">stmpe_i2c_remove /a>),>  92 /a>        . a href="+code=id_table" class="sref">id_table /a>       =  a href="+code=stmpe_i2c_id" class="sref">stmpe_i2c_id /a>,>  93 /a>};>  94 /a>>  95 /a>static int  a href="+code=__init" class="sref">__init /a>  a href="+code=stmpe_init" class="sref">stmpe_init /a>(void)>  960{>  97 /a>        return  a href="+code=i2c_add_driver" class="sref">i2c_add_driver /a>(& a href="+code=stmpe_i2c_driver" class="sref">stmpe_i2c_driver /a>);>  98 /a>}>  99 /a> a href="+code=subsys_initcall" class="sref">subsys_initcall /a>( a href="+code=stmpe_init" class="sref">stmpe_init /a>);> 100 /a>> 101 /a>static void  a href="+code=__exit" class="sref">__exit /a>  a href="+code=stmpe_exit" class="sref">stmpe_exit /a>(void)> 1020{> 103 /a>         a href="+code=i2c_del_driver" class="sref">i2c_del_driver /a>(& a href="+code=stmpe_i2c_driver" class="sref">stmpe_i2c_driver /a>);> 104 /a>}> 105 /a> a href="+code=module_exit" class="sref">module_exit /a>( a href="+code=stmpe_exit" class="sref">stmpe_exit /a>);> 106 /a>> 107 /a> a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE /a>( spao class="string">"GPL v2" 108 /a> a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION /a>( spao class="string">"STMPE MFD I2C Interface Driver" 109 /a> a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR /a>( spao class="string">"Rabin Vincent <rabin.vincent@stericssio.com>" 1.10 /pre>

 /divn>
 div class="footer">
The original LXR software by the LXR community /a>, this experimental verstionby lxr@linux.no /a>.
 /divn> div class="subfooter">
lxr.linux.no kindly hostednby Redpill Linpro AS /a>, provider of Linux consulting and operaptios services since 1995.
 /divn>
 /bodyn> /htmln>