2 * LP5521/LP5523/LP55231 Common Driver
4 * Copyright 2012 Texas Instruments
6 * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * Derived from leds-lp5521.c, leds-lp5523.c
15 #include <linux/i2c.h>
16 #include <linux/leds.h>
17 #include <linux/module.h>
18 #include <linux/platform_data/leds-lp55xx.h>
20 #include "leds-lp55xx-common.h"
22 int lp55xx_write(struct lp55xx_chip *chip, u8 reg, u8 val)
24 return i2c_smbus_write_byte_data(chip->cl, reg, val);
26 EXPORT_SYMBOL_GPL(lp55xx_write);
28 int lp55xx_read(struct lp55xx_chip *chip, u8 reg, u8 *val)
32 ret = i2c_smbus_read_byte_data(chip->cl, reg);
39 EXPORT_SYMBOL_GPL(lp55xx_read);
41 int lp55xx_update_bits(struct lp55xx_chip *chip, u8 reg, u8 mask, u8 val)
46 ret = lp55xx_read(chip, reg, &tmp);
53 return lp55xx_write(chip, reg, tmp);
55 EXPORT_SYMBOL_GPL(lp55xx_update_bits);
57 MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>");
58 MODULE_DESCRIPTION("LP55xx Common Driver");
59 MODULE_LICENSE("GPL");