Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
locomo.h File Reference

Go to the source code of this file.

Data Structures

struct  locomo_dev
 
struct  locomo_driver
 
struct  locomo_platform_data
 

Macros

#define locomo_writel(val, addr)   ({ *(volatile u16 *)(addr) = (val); })
 
#define locomo_readl(addr)   (*(volatile u16 *)(addr))
 
#define LOCOMO_VER   0x00
 
#define LOCOMO_ST   0x04
 
#define LOCOMO_C32K   0x08
 
#define LOCOMO_ICR   0x0C
 
#define LOCOMO_MCSX0   0x10
 
#define LOCOMO_MCSX1   0x14
 
#define LOCOMO_MCSX2   0x18
 
#define LOCOMO_MCSX3   0x1c
 
#define LOCOMO_ASD   0x20 /* AD start delay */
 
#define LOCOMO_HSD   0x28 /* HSYS delay */
 
#define LOCOMO_HSC   0x2c /* HSYS period */
 
#define LOCOMO_TADC   0x30 /* tablet ADC clock */
 
#define LOCOMO_LTC   0xd8 /* LTC interrupt setting */
 
#define LOCOMO_LTINT   0xdc /* LTC interrupt */
 
#define LOCOMO_DAC   0xe0
 
#define LOCOMO_DAC_SCLOEB   0x08 /* SCL pin output data */
 
#define LOCOMO_DAC_TEST   0x04 /* Test bit */
 
#define LOCOMO_DAC_SDA   0x02 /* SDA pin level (read-only) */
 
#define LOCOMO_DAC_SDAOEB   0x01 /* SDA pin output data */
 
#define LOCOMO_SPI   0x60
 
#define LOCOMO_SPIMD   0x00 /* SPI mode setting */
 
#define LOCOMO_SPICT   0x04 /* SPI mode control */
 
#define LOCOMO_SPIST   0x08 /* SPI status */
 
#define LOCOMO_SPI_TEND   (1 << 3) /* Transfer end bit */
 
#define LOCOMO_SPI_REND   (1 << 2) /* Receive end bit */
 
#define LOCOMO_SPI_RFW   (1 << 1) /* write buffer bit */
 
#define LOCOMO_SPI_RFR   (1) /* read buffer bit */
 
#define LOCOMO_SPIIS   0x10 /* SPI interrupt status */
 
#define LOCOMO_SPIWE   0x14 /* SPI interrupt status write enable */
 
#define LOCOMO_SPIIE   0x18 /* SPI interrupt enable */
 
#define LOCOMO_SPIIR   0x1c /* SPI interrupt request */
 
#define LOCOMO_SPITD   0x20 /* SPI transfer data write */
 
#define LOCOMO_SPIRD   0x24 /* SPI receive data read */
 
#define LOCOMO_SPITS   0x28 /* SPI transfer data shift */
 
#define LOCOMO_SPIRS   0x2C /* SPI receive data shift */
 
#define LOCOMO_GPD   0x90 /* GPIO direction */
 
#define LOCOMO_GPE   0x94 /* GPIO input enable */
 
#define LOCOMO_GPL   0x98 /* GPIO level */
 
#define LOCOMO_GPO   0x9c /* GPIO out data setting */
 
#define LOCOMO_GRIE   0xa0 /* GPIO rise detection */
 
#define LOCOMO_GFIE   0xa4 /* GPIO fall detection */
 
#define LOCOMO_GIS   0xa8 /* GPIO edge detection status */
 
#define LOCOMO_GWE   0xac /* GPIO status write enable */
 
#define LOCOMO_GIE   0xb0 /* GPIO interrupt enable */
 
#define LOCOMO_GIR   0xb4 /* GPIO interrupt request */
 
#define LOCOMO_GPIO(Nb)   (0x01 << (Nb))
 
#define LOCOMO_GPIO_RTS   LOCOMO_GPIO(0)
 
#define LOCOMO_GPIO_CTS   LOCOMO_GPIO(1)
 
#define LOCOMO_GPIO_DSR   LOCOMO_GPIO(2)
 
#define LOCOMO_GPIO_DTR   LOCOMO_GPIO(3)
 
#define LOCOMO_GPIO_LCD_VSHA_ON   LOCOMO_GPIO(4)
 
#define LOCOMO_GPIO_LCD_VSHD_ON   LOCOMO_GPIO(5)
 
#define LOCOMO_GPIO_LCD_VEE_ON   LOCOMO_GPIO(6)
 
#define LOCOMO_GPIO_LCD_MOD   LOCOMO_GPIO(7)
 
#define LOCOMO_GPIO_DAC_ON   LOCOMO_GPIO(8)
 
#define LOCOMO_GPIO_FL_VR   LOCOMO_GPIO(9)
 
#define LOCOMO_GPIO_DAC_SDATA   LOCOMO_GPIO(10)
 
#define LOCOMO_GPIO_DAC_SCK   LOCOMO_GPIO(11)
 
#define LOCOMO_GPIO_DAC_SLOAD   LOCOMO_GPIO(12)
 
#define LOCOMO_GPIO_CARD_DETECT   LOCOMO_GPIO(13)
 
#define LOCOMO_GPIO_WRITE_PROT   LOCOMO_GPIO(14)
 
#define LOCOMO_GPIO_CARD_POWER   LOCOMO_GPIO(15)
 
#define LOCOMO_KEYBOARD   0x40
 
#define LOCOMO_KIB   0x00 /* KIB level */
 
#define LOCOMO_KSC   0x04 /* KSTRB control */
 
#define LOCOMO_KCMD   0x08 /* KSTRB command */
 
#define LOCOMO_KIC   0x0c /* Key interrupt */
 
#define LOCOMO_FRONTLIGHT   0xc8
 
#define LOCOMO_ALS   0x00 /* Adjust light cycle */
 
#define LOCOMO_ALD   0x04 /* Adjust light duty */
 
#define LOCOMO_ALC_EN   0x8000
 
#define LOCOMO_BACKLIGHT   0x38
 
#define LOCOMO_TC   0x00 /* TFT control signal */
 
#define LOCOMO_CPSD   0x04 /* CPS delay */
 
#define LOCOMO_AUDIO   0x54
 
#define LOCOMO_ACC   0x00 /* Audio clock */
 
#define LOCOMO_PAIF   0xD0 /* PCM audio interface */
 
#define LOCOMO_ACC_XON   0x80
 
#define LOCOMO_ACC_XEN   0x40
 
#define LOCOMO_ACC_XSEL0   0x00
 
#define LOCOMO_ACC_XSEL1   0x20
 
#define LOCOMO_ACC_MCLKEN   0x10
 
#define LOCOMO_ACC_64FSEN   0x08
 
#define LOCOMO_ACC_CLKSEL000   0x00 /* mclk 2 */
 
#define LOCOMO_ACC_CLKSEL001   0x01 /* mclk 3 */
 
#define LOCOMO_ACC_CLKSEL010   0x02 /* mclk 4 */
 
#define LOCOMO_ACC_CLKSEL011   0x03 /* mclk 6 */
 
#define LOCOMO_ACC_CLKSEL100   0x04 /* mclk 8 */
 
#define LOCOMO_ACC_CLKSEL101   0x05 /* mclk 12 */
 
#define LOCOMO_PAIF_SCINV   0x20
 
#define LOCOMO_PAIF_SCEN   0x10
 
#define LOCOMO_PAIF_LRCRST   0x08
 
#define LOCOMO_PAIF_LRCEVE   0x04
 
#define LOCOMO_PAIF_LRCINV   0x02
 
#define LOCOMO_PAIF_LRCEN   0x01
 
#define LOCOMO_LED   0xe8
 
#define LOCOMO_LPT0   0x00
 
#define LOCOMO_LPT1   0x04
 
#define LOCOMO_LPT_TOFH   0x80
 
#define LOCOMO_LPT_TOFL   0x08
 
#define LOCOMO_LPT_TOH(TOH)   ((TOH & 0x7) << 4)
 
#define LOCOMO_LPT_TOL(TOL)   ((TOL & 0x7))
 
#define LOCOMO_DEVID_KEYBOARD   0
 
#define LOCOMO_DEVID_FRONTLIGHT   1
 
#define LOCOMO_DEVID_BACKLIGHT   2
 
#define LOCOMO_DEVID_AUDIO   3
 
#define LOCOMO_DEVID_LED   4
 
#define LOCOMO_DEVID_UART   5
 
#define LOCOMO_DEVID_SPI   6
 
#define LOCOMO_DEV(_d)   container_of((_d), struct locomo_dev, dev)
 
#define locomo_get_drvdata(d)   dev_get_drvdata(&(d)->dev)
 
#define locomo_set_drvdata(d, p)   dev_set_drvdata(&(d)->dev, p)
 
#define LOCOMO_DRV(_d)   container_of((_d), struct locomo_driver, drv)
 
#define LOCOMO_DRIVER_NAME(_ldev)   ((_ldev)->dev.driver->name)
 

Functions

void locomo_lcd_power (struct locomo_dev *, int, unsigned int)
 
int locomo_driver_register (struct locomo_driver *)
 
void locomo_driver_unregister (struct locomo_driver *)
 
void locomo_gpio_set_dir (struct device *dev, unsigned int bits, unsigned int dir)
 
int locomo_gpio_read_level (struct device *dev, unsigned int bits)
 
int locomo_gpio_read_output (struct device *dev, unsigned int bits)
 
void locomo_gpio_write (struct device *dev, unsigned int bits, unsigned int set)
 
void locomo_m62332_senddata (struct locomo_dev *ldev, unsigned int dac_data, int channel)
 
void locomo_frontlight_set (struct locomo_dev *dev, int duty, int vr, int bpwf)
 

Variables

struct bus_type locomo_bus_type
 

Macro Definition Documentation

#define LOCOMO_ACC   0x00 /* Audio clock */

Definition at line 128 of file locomo.h.

#define LOCOMO_ACC_64FSEN   0x08

Definition at line 136 of file locomo.h.

#define LOCOMO_ACC_CLKSEL000   0x00 /* mclk 2 */

Definition at line 137 of file locomo.h.

#define LOCOMO_ACC_CLKSEL001   0x01 /* mclk 3 */

Definition at line 138 of file locomo.h.

#define LOCOMO_ACC_CLKSEL010   0x02 /* mclk 4 */

Definition at line 139 of file locomo.h.

#define LOCOMO_ACC_CLKSEL011   0x03 /* mclk 6 */

Definition at line 140 of file locomo.h.

#define LOCOMO_ACC_CLKSEL100   0x04 /* mclk 8 */

Definition at line 141 of file locomo.h.

#define LOCOMO_ACC_CLKSEL101   0x05 /* mclk 12 */

Definition at line 142 of file locomo.h.

#define LOCOMO_ACC_MCLKEN   0x10

Definition at line 135 of file locomo.h.

#define LOCOMO_ACC_XEN   0x40

Definition at line 132 of file locomo.h.

#define LOCOMO_ACC_XON   0x80

Definition at line 131 of file locomo.h.

#define LOCOMO_ACC_XSEL0   0x00

Definition at line 133 of file locomo.h.

#define LOCOMO_ACC_XSEL1   0x20

Definition at line 134 of file locomo.h.

#define LOCOMO_ALC_EN   0x8000

Definition at line 119 of file locomo.h.

#define LOCOMO_ALD   0x04 /* Adjust light duty */

Definition at line 117 of file locomo.h.

#define LOCOMO_ALS   0x00 /* Adjust light cycle */

Definition at line 116 of file locomo.h.

#define LOCOMO_ASD   0x20 /* AD start delay */

Definition at line 38 of file locomo.h.

#define LOCOMO_AUDIO   0x54

Definition at line 127 of file locomo.h.

#define LOCOMO_BACKLIGHT   0x38

Definition at line 122 of file locomo.h.

#define LOCOMO_C32K   0x08

Definition at line 26 of file locomo.h.

#define LOCOMO_CPSD   0x04 /* CPS delay */

Definition at line 124 of file locomo.h.

#define LOCOMO_DAC   0xe0

Definition at line 49 of file locomo.h.

#define LOCOMO_DAC_SCLOEB   0x08 /* SCL pin output data */

Definition at line 51 of file locomo.h.

#define LOCOMO_DAC_SDA   0x02 /* SDA pin level (read-only) */

Definition at line 53 of file locomo.h.

#define LOCOMO_DAC_SDAOEB   0x01 /* SDA pin output data */

Definition at line 54 of file locomo.h.

#define LOCOMO_DAC_TEST   0x04 /* Test bit */

Definition at line 52 of file locomo.h.

#define LOCOMO_DEV (   _d)    container_of((_d), struct locomo_dev, dev)

Definition at line 182 of file locomo.h.

#define LOCOMO_DEVID_AUDIO   3

Definition at line 166 of file locomo.h.

#define LOCOMO_DEVID_BACKLIGHT   2

Definition at line 165 of file locomo.h.

#define LOCOMO_DEVID_FRONTLIGHT   1

Definition at line 164 of file locomo.h.

#define LOCOMO_DEVID_KEYBOARD   0

Definition at line 163 of file locomo.h.

#define LOCOMO_DEVID_LED   4

Definition at line 167 of file locomo.h.

#define LOCOMO_DEVID_SPI   6

Definition at line 169 of file locomo.h.

#define LOCOMO_DEVID_UART   5

Definition at line 168 of file locomo.h.

#define LOCOMO_DRIVER_NAME (   _ldev)    ((_ldev)->dev.driver->name)

Definition at line 198 of file locomo.h.

#define LOCOMO_DRV (   _d)    container_of((_d), struct locomo_driver, drv)

Definition at line 196 of file locomo.h.

#define LOCOMO_FRONTLIGHT   0xc8

Definition at line 115 of file locomo.h.

#define locomo_get_drvdata (   d)    dev_get_drvdata(&(d)->dev)

Definition at line 184 of file locomo.h.

#define LOCOMO_GFIE   0xa4 /* GPIO fall detection */

Definition at line 81 of file locomo.h.

#define LOCOMO_GIE   0xb0 /* GPIO interrupt enable */

Definition at line 84 of file locomo.h.

#define LOCOMO_GIR   0xb4 /* GPIO interrupt request */

Definition at line 85 of file locomo.h.

#define LOCOMO_GIS   0xa8 /* GPIO edge detection status */

Definition at line 82 of file locomo.h.

#define LOCOMO_GPD   0x90 /* GPIO direction */

Definition at line 76 of file locomo.h.

#define LOCOMO_GPE   0x94 /* GPIO input enable */

Definition at line 77 of file locomo.h.

#define LOCOMO_GPIO (   Nb)    (0x01 << (Nb))

Definition at line 86 of file locomo.h.

#define LOCOMO_GPIO_CARD_DETECT   LOCOMO_GPIO(13)

Definition at line 100 of file locomo.h.

#define LOCOMO_GPIO_CARD_POWER   LOCOMO_GPIO(15)

Definition at line 102 of file locomo.h.

#define LOCOMO_GPIO_CTS   LOCOMO_GPIO(1)

Definition at line 88 of file locomo.h.

#define LOCOMO_GPIO_DAC_ON   LOCOMO_GPIO(8)

Definition at line 95 of file locomo.h.

#define LOCOMO_GPIO_DAC_SCK   LOCOMO_GPIO(11)

Definition at line 98 of file locomo.h.

#define LOCOMO_GPIO_DAC_SDATA   LOCOMO_GPIO(10)

Definition at line 97 of file locomo.h.

#define LOCOMO_GPIO_DAC_SLOAD   LOCOMO_GPIO(12)

Definition at line 99 of file locomo.h.

#define LOCOMO_GPIO_DSR   LOCOMO_GPIO(2)

Definition at line 89 of file locomo.h.

#define LOCOMO_GPIO_DTR   LOCOMO_GPIO(3)

Definition at line 90 of file locomo.h.

#define LOCOMO_GPIO_FL_VR   LOCOMO_GPIO(9)

Definition at line 96 of file locomo.h.

#define LOCOMO_GPIO_LCD_MOD   LOCOMO_GPIO(7)

Definition at line 94 of file locomo.h.

#define LOCOMO_GPIO_LCD_VEE_ON   LOCOMO_GPIO(6)

Definition at line 93 of file locomo.h.

#define LOCOMO_GPIO_LCD_VSHA_ON   LOCOMO_GPIO(4)

Definition at line 91 of file locomo.h.

#define LOCOMO_GPIO_LCD_VSHD_ON   LOCOMO_GPIO(5)

Definition at line 92 of file locomo.h.

#define LOCOMO_GPIO_RTS   LOCOMO_GPIO(0)

Definition at line 87 of file locomo.h.

#define LOCOMO_GPIO_WRITE_PROT   LOCOMO_GPIO(14)

Definition at line 101 of file locomo.h.

#define LOCOMO_GPL   0x98 /* GPIO level */

Definition at line 78 of file locomo.h.

#define LOCOMO_GPO   0x9c /* GPIO out data setting */

Definition at line 79 of file locomo.h.

#define LOCOMO_GRIE   0xa0 /* GPIO rise detection */

Definition at line 80 of file locomo.h.

#define LOCOMO_GWE   0xac /* GPIO status write enable */

Definition at line 83 of file locomo.h.

#define LOCOMO_HSC   0x2c /* HSYS period */

Definition at line 40 of file locomo.h.

#define LOCOMO_HSD   0x28 /* HSYS delay */

Definition at line 39 of file locomo.h.

#define LOCOMO_ICR   0x0C

Definition at line 29 of file locomo.h.

#define LOCOMO_KCMD   0x08 /* KSTRB command */

Definition at line 111 of file locomo.h.

#define LOCOMO_KEYBOARD   0x40

Definition at line 108 of file locomo.h.

#define LOCOMO_KIB   0x00 /* KIB level */

Definition at line 109 of file locomo.h.

#define LOCOMO_KIC   0x0c /* Key interrupt */

Definition at line 112 of file locomo.h.

#define LOCOMO_KSC   0x04 /* KSTRB control */

Definition at line 110 of file locomo.h.

#define LOCOMO_LED   0xe8

Definition at line 152 of file locomo.h.

#define LOCOMO_LPT0   0x00

Definition at line 153 of file locomo.h.

#define LOCOMO_LPT1   0x04

Definition at line 154 of file locomo.h.

#define LOCOMO_LPT_TOFH   0x80

Definition at line 156 of file locomo.h.

#define LOCOMO_LPT_TOFL   0x08

Definition at line 157 of file locomo.h.

#define LOCOMO_LPT_TOH (   TOH)    ((TOH & 0x7) << 4)

Definition at line 158 of file locomo.h.

#define LOCOMO_LPT_TOL (   TOL)    ((TOL & 0x7))

Definition at line 159 of file locomo.h.

#define LOCOMO_LTC   0xd8 /* LTC interrupt setting */

Definition at line 45 of file locomo.h.

#define LOCOMO_LTINT   0xdc /* LTC interrupt */

Definition at line 46 of file locomo.h.

#define LOCOMO_MCSX0   0x10

Definition at line 32 of file locomo.h.

#define LOCOMO_MCSX1   0x14

Definition at line 33 of file locomo.h.

#define LOCOMO_MCSX2   0x18

Definition at line 34 of file locomo.h.

#define LOCOMO_MCSX3   0x1c

Definition at line 35 of file locomo.h.

#define LOCOMO_PAIF   0xD0 /* PCM audio interface */

Definition at line 129 of file locomo.h.

#define LOCOMO_PAIF_LRCEN   0x01

Definition at line 149 of file locomo.h.

#define LOCOMO_PAIF_LRCEVE   0x04

Definition at line 147 of file locomo.h.

#define LOCOMO_PAIF_LRCINV   0x02

Definition at line 148 of file locomo.h.

#define LOCOMO_PAIF_LRCRST   0x08

Definition at line 146 of file locomo.h.

#define LOCOMO_PAIF_SCEN   0x10

Definition at line 145 of file locomo.h.

#define LOCOMO_PAIF_SCINV   0x20

Definition at line 144 of file locomo.h.

#define locomo_readl (   addr)    (*(volatile u16 *)(addr))

Definition at line 17 of file locomo.h.

#define locomo_set_drvdata (   d,
  p 
)    dev_set_drvdata(&(d)->dev, p)

Definition at line 185 of file locomo.h.

#define LOCOMO_SPI   0x60

Definition at line 57 of file locomo.h.

#define LOCOMO_SPI_REND   (1 << 2) /* Receive end bit */

Definition at line 62 of file locomo.h.

#define LOCOMO_SPI_RFR   (1) /* read buffer bit */

Definition at line 64 of file locomo.h.

#define LOCOMO_SPI_RFW   (1 << 1) /* write buffer bit */

Definition at line 63 of file locomo.h.

#define LOCOMO_SPI_TEND   (1 << 3) /* Transfer end bit */

Definition at line 61 of file locomo.h.

#define LOCOMO_SPICT   0x04 /* SPI mode control */

Definition at line 59 of file locomo.h.

#define LOCOMO_SPIIE   0x18 /* SPI interrupt enable */

Definition at line 68 of file locomo.h.

#define LOCOMO_SPIIR   0x1c /* SPI interrupt request */

Definition at line 69 of file locomo.h.

#define LOCOMO_SPIIS   0x10 /* SPI interrupt status */

Definition at line 66 of file locomo.h.

#define LOCOMO_SPIMD   0x00 /* SPI mode setting */

Definition at line 58 of file locomo.h.

#define LOCOMO_SPIRD   0x24 /* SPI receive data read */

Definition at line 71 of file locomo.h.

#define LOCOMO_SPIRS   0x2C /* SPI receive data shift */

Definition at line 73 of file locomo.h.

#define LOCOMO_SPIST   0x08 /* SPI status */

Definition at line 60 of file locomo.h.

#define LOCOMO_SPITD   0x20 /* SPI transfer data write */

Definition at line 70 of file locomo.h.

#define LOCOMO_SPITS   0x28 /* SPI transfer data shift */

Definition at line 72 of file locomo.h.

#define LOCOMO_SPIWE   0x14 /* SPI interrupt status write enable */

Definition at line 67 of file locomo.h.

#define LOCOMO_ST   0x04

Definition at line 23 of file locomo.h.

#define LOCOMO_TADC   0x30 /* tablet ADC clock */

Definition at line 41 of file locomo.h.

#define LOCOMO_TC   0x00 /* TFT control signal */

Definition at line 123 of file locomo.h.

#define LOCOMO_VER   0x00

Definition at line 20 of file locomo.h.

#define locomo_writel (   val,
  addr 
)    ({ *(volatile u16 *)(addr) = (val); })

Definition at line 16 of file locomo.h.

Function Documentation

int locomo_driver_register ( struct locomo_driver )

Definition at line 882 of file locomo.c.

void locomo_driver_unregister ( struct locomo_driver )

Definition at line 889 of file locomo.c.

void locomo_frontlight_set ( struct locomo_dev dev,
int  duty,
int  vr,
int  bpwf 
)

Definition at line 796 of file locomo.c.

int locomo_gpio_read_level ( struct device dev,
unsigned int  bits 
)

Definition at line 569 of file locomo.c.

int locomo_gpio_read_output ( struct device dev,
unsigned int  bits 
)

Definition at line 587 of file locomo.c.

void locomo_gpio_set_dir ( struct device dev,
unsigned int  bits,
unsigned int  dir 
)

Definition at line 540 of file locomo.c.

void locomo_gpio_write ( struct device dev,
unsigned int  bits,
unsigned int  set 
)

Definition at line 605 of file locomo.c.

void locomo_lcd_power ( struct locomo_dev ,
int  ,
unsigned  int 
)
void locomo_m62332_senddata ( struct locomo_dev ldev,
unsigned int  dac_data,
int  channel 
)

Definition at line 662 of file locomo.c.

Variable Documentation

struct bus_type locomo_bus_type

Definition at line 873 of file locomo.c.