Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
lm3533-core.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/mfd/core.h>
#include <linux/regmap.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/mfd/lm3533.h>

Go to the source code of this file.

Data Structures

struct  lm3533_device_attribute
 

Macros

#define LM3533_BOOST_OVP_MASK   0x06
 
#define LM3533_BOOST_OVP_SHIFT   1
 
#define LM3533_BOOST_FREQ_MASK   0x01
 
#define LM3533_BOOST_FREQ_SHIFT   0
 
#define LM3533_BL_ID_MASK   1
 
#define LM3533_LED_ID_MASK   3
 
#define LM3533_BL_ID_MAX   1
 
#define LM3533_LED_ID_MAX   3
 
#define LM3533_HVLED_ID_MAX   2
 
#define LM3533_LVLED_ID_MAX   5
 
#define LM3533_REG_OUTPUT_CONF1   0x10
 
#define LM3533_REG_OUTPUT_CONF2   0x11
 
#define LM3533_REG_BOOST_PWM   0x2c
 
#define LM3533_REG_MAX   0xb2
 
#define to_lm3533_dev_attr(_attr)   container_of(_attr, struct lm3533_device_attribute, dev_attr)
 
#define LM3533_OUTPUT_ATTR(_name, _mode, _show, _store, _type, _id)
 
#define LM3533_OUTPUT_ATTR_RW(_name, _type, _id)
 
#define LM3533_OUTPUT_HVLED_ATTR_RW(_nr)   LM3533_OUTPUT_ATTR_RW(hvled##_nr, LM3533_ATTR_TYPE_BACKLIGHT, _nr)
 
#define LM3533_OUTPUT_LVLED_ATTR_RW(_nr)   LM3533_OUTPUT_ATTR_RW(lvled##_nr, LM3533_ATTR_TYPE_LED, _nr)
 
#define to_dev_attr(_attr)   container_of(_attr, struct device_attribute, attr)
 

Enumerations

enum  lm3533_attribute_type { LM3533_ATTR_TYPE_BACKLIGHT, LM3533_ATTR_TYPE_LED }
 

Functions

int lm3533_read (struct lm3533 *lm3533, u8 reg, u8 *val)
 
 EXPORT_SYMBOL_GPL (lm3533_read)
 
int lm3533_write (struct lm3533 *lm3533, u8 reg, u8 val)
 
 EXPORT_SYMBOL_GPL (lm3533_write)
 
int lm3533_update (struct lm3533 *lm3533, u8 reg, u8 val, u8 mask)
 
 EXPORT_SYMBOL_GPL (lm3533_update)
 
 MODULE_DEVICE_TABLE (i2c, lm3533_i2c_ids)
 
 subsys_initcall (lm3533_i2c_init)
 
 module_exit (lm3533_i2c_exit)
 
 MODULE_AUTHOR ("Johan Hovold <[email protected]>")
 
 MODULE_DESCRIPTION ("LM3533 Core")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define LM3533_BL_ID_MASK   1

Definition at line 35 of file lm3533-core.c.

#define LM3533_BL_ID_MAX   1

Definition at line 37 of file lm3533-core.c.

#define LM3533_BOOST_FREQ_MASK   0x01

Definition at line 32 of file lm3533-core.c.

#define LM3533_BOOST_FREQ_SHIFT   0

Definition at line 33 of file lm3533-core.c.

#define LM3533_BOOST_OVP_MASK   0x06

Definition at line 29 of file lm3533-core.c.

#define LM3533_BOOST_OVP_SHIFT   1

Definition at line 30 of file lm3533-core.c.

#define LM3533_HVLED_ID_MAX   2

Definition at line 40 of file lm3533-core.c.

#define LM3533_LED_ID_MASK   3

Definition at line 36 of file lm3533-core.c.

#define LM3533_LED_ID_MAX   3

Definition at line 38 of file lm3533-core.c.

#define LM3533_LVLED_ID_MAX   5

Definition at line 41 of file lm3533-core.c.

#define LM3533_OUTPUT_ATTR (   _name,
  _mode,
  _show,
  _store,
  _type,
  _id 
)
Value:
struct lm3533_device_attribute lm3533_dev_attr_##_name = \
{ .dev_attr = __ATTR(_name, _mode, _show, _store), \
.type = _type, \
.u.output = { .id = _id }, }

Definition at line 320 of file lm3533-core.c.

#define LM3533_OUTPUT_ATTR_RW (   _name,
  _type,
  _id 
)
Value:
LM3533_OUTPUT_ATTR(output_##_name, S_IRUGO | S_IWUSR, \
show_output, store_output, _type, _id)

Definition at line 326 of file lm3533-core.c.

#define LM3533_OUTPUT_HVLED_ATTR_RW (   _nr)    LM3533_OUTPUT_ATTR_RW(hvled##_nr, LM3533_ATTR_TYPE_BACKLIGHT, _nr)

Definition at line 330 of file lm3533-core.c.

#define LM3533_OUTPUT_LVLED_ATTR_RW (   _nr)    LM3533_OUTPUT_ATTR_RW(lvled##_nr, LM3533_ATTR_TYPE_LED, _nr)

Definition at line 332 of file lm3533-core.c.

#define LM3533_REG_BOOST_PWM   0x2c

Definition at line 45 of file lm3533-core.c.

#define LM3533_REG_MAX   0xb2

Definition at line 47 of file lm3533-core.c.

#define LM3533_REG_OUTPUT_CONF1   0x10

Definition at line 43 of file lm3533-core.c.

#define LM3533_REG_OUTPUT_CONF2   0x11

Definition at line 44 of file lm3533-core.c.

#define to_dev_attr (   _attr)    container_of(_attr, struct device_attribute, attr)

Definition at line 359 of file lm3533-core.c.

#define to_lm3533_dev_attr (   _attr)    container_of(_attr, struct lm3533_device_attribute, dev_attr)

Definition at line 257 of file lm3533-core.c.

Enumeration Type Documentation

Enumerator:
LM3533_ATTR_TYPE_BACKLIGHT 
LM3533_ATTR_TYPE_LED 

Definition at line 242 of file lm3533-core.c.

Function Documentation

EXPORT_SYMBOL_GPL ( lm3533_read  )
EXPORT_SYMBOL_GPL ( lm3533_write  )
EXPORT_SYMBOL_GPL ( lm3533_update  )
int lm3533_read ( struct lm3533 lm3533,
u8  reg,
u8 val 
)

Definition at line 87 of file lm3533-core.c.

int lm3533_update ( struct lm3533 lm3533,
u8  reg,
u8  val,
u8  mask 
)

Definition at line 123 of file lm3533-core.c.

int lm3533_write ( struct lm3533 lm3533,
u8  reg,
u8  val 
)

Definition at line 107 of file lm3533-core.c.

MODULE_AUTHOR ( "Johan Hovold <[email protected]>"  )
MODULE_DESCRIPTION ( "LM3533 Core"  )
MODULE_DEVICE_TABLE ( i2c  ,
lm3533_i2c_ids   
)
module_exit ( lm3533_i2c_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( lm3533_i2c_init  )