lm3533 51 drivers/iio/light/lm3533-als.c struct lm3533 *lm3533; lm3533 75 drivers/iio/light/lm3533-als.c ret = lm3533_read(als->lm3533, reg, &val); lm3533 92 drivers/iio/light/lm3533-als.c ret = lm3533_read(als->lm3533, LM3533_REG_ALS_ZONE_INFO, &val); lm3533 143 drivers/iio/light/lm3533-als.c ret = lm3533_read(als->lm3533, reg, val); lm3533 164 drivers/iio/light/lm3533-als.c ret = lm3533_write(als->lm3533, reg, val); lm3533 283 drivers/iio/light/lm3533-als.c ret = lm3533_update(als->lm3533, LM3533_REG_ALS_ZONE_INFO, val, mask); lm3533 300 drivers/iio/light/lm3533-als.c ret = lm3533_read(als->lm3533, LM3533_REG_ALS_ZONE_INFO, &val); lm3533 329 drivers/iio/light/lm3533-als.c ret = lm3533_read(als->lm3533, reg, val); lm3533 351 drivers/iio/light/lm3533-als.c ret = lm3533_read(als->lm3533, reg2, &val2); lm3533 366 drivers/iio/light/lm3533-als.c ret = lm3533_write(als->lm3533, reg, val); lm3533 728 drivers/iio/light/lm3533-als.c ret = lm3533_update(als->lm3533, LM3533_REG_ALS_CONF, val, mask); lm3533 747 drivers/iio/light/lm3533-als.c ret = lm3533_write(als->lm3533, LM3533_REG_ALS_RESISTOR_SELECT, val); lm3533 781 drivers/iio/light/lm3533-als.c ret = lm3533_update(als->lm3533, LM3533_REG_ALS_ZONE_INFO, 0, mask); lm3533 804 drivers/iio/light/lm3533-als.c ret = lm3533_update(als->lm3533, LM3533_REG_ALS_CONF, mask, mask); lm3533 816 drivers/iio/light/lm3533-als.c ret = lm3533_update(als->lm3533, LM3533_REG_ALS_CONF, 0, mask); lm3533 831 drivers/iio/light/lm3533-als.c struct lm3533 *lm3533; lm3533 837 drivers/iio/light/lm3533-als.c lm3533 = dev_get_drvdata(pdev->dev.parent); lm3533 838 drivers/iio/light/lm3533-als.c if (!lm3533) lm3533 859 drivers/iio/light/lm3533-als.c als->lm3533 = lm3533; lm3533 861 drivers/iio/light/lm3533-als.c als->irq = lm3533->irq; lm3533 44 drivers/leds/leds-lm3533.c struct lm3533 *lm3533; lm3533 104 drivers/leds/leds-lm3533.c ret = lm3533_update(led->lm3533, LM3533_REG_PATTERN_ENABLE, val, mask); lm3533 262 drivers/leds/leds-lm3533.c ret = lm3533_write(led->lm3533, reg, val); lm3533 343 drivers/leds/leds-lm3533.c ret = lm3533_read(led->lm3533, reg, &val); lm3533 378 drivers/leds/leds-lm3533.c ret = lm3533_write(led->lm3533, reg, val); lm3533 412 drivers/leds/leds-lm3533.c ret = lm3533_read(led->lm3533, reg, &val); lm3533 444 drivers/leds/leds-lm3533.c ret = lm3533_update(led->lm3533, reg, val, mask); lm3533 462 drivers/leds/leds-lm3533.c ret = lm3533_read(led->lm3533, reg, &val); lm3533 494 drivers/leds/leds-lm3533.c ret = lm3533_update(led->lm3533, reg, val, mask); lm3533 512 drivers/leds/leds-lm3533.c ret = lm3533_read(led->lm3533, reg, &val); lm3533 547 drivers/leds/leds-lm3533.c ret = lm3533_update(led->lm3533, reg, val, mask); lm3533 618 drivers/leds/leds-lm3533.c if (!led->lm3533->have_als) lm3533 649 drivers/leds/leds-lm3533.c struct lm3533 *lm3533; lm3533 656 drivers/leds/leds-lm3533.c lm3533 = dev_get_drvdata(pdev->dev.parent); lm3533 657 drivers/leds/leds-lm3533.c if (!lm3533) lm3533 675 drivers/leds/leds-lm3533.c led->lm3533 = lm3533; lm3533 691 drivers/leds/leds-lm3533.c led->cb.lm3533 = lm3533; lm3533 693 drivers/leds/leds-lm3533.c led->cb.dev = lm3533->dev; lm3533 83 drivers/mfd/lm3533-core.c int lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val) lm3533 88 drivers/mfd/lm3533-core.c ret = regmap_read(lm3533->regmap, reg, &tmp); lm3533 90 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to read register %02x: %d\n", lm3533 97 drivers/mfd/lm3533-core.c dev_dbg(lm3533->dev, "read [%02x]: %02x\n", reg, *val); lm3533 103 drivers/mfd/lm3533-core.c int lm3533_write(struct lm3533 *lm3533, u8 reg, u8 val) lm3533 107 drivers/mfd/lm3533-core.c dev_dbg(lm3533->dev, "write [%02x]: %02x\n", reg, val); lm3533 109 drivers/mfd/lm3533-core.c ret = regmap_write(lm3533->regmap, reg, val); lm3533 111 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to write register %02x: %d\n", lm3533 119 drivers/mfd/lm3533-core.c int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask) lm3533 123 drivers/mfd/lm3533-core.c dev_dbg(lm3533->dev, "update [%02x]: %02x/%02x\n", reg, val, mask); lm3533 125 drivers/mfd/lm3533-core.c ret = regmap_update_bits(lm3533->regmap, reg, mask, val); lm3533 127 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to update register %02x: %d\n", lm3533 135 drivers/mfd/lm3533-core.c static int lm3533_set_boost_freq(struct lm3533 *lm3533, lm3533 140 drivers/mfd/lm3533-core.c ret = lm3533_update(lm3533, LM3533_REG_BOOST_PWM, lm3533 144 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to set boost frequency\n"); lm3533 150 drivers/mfd/lm3533-core.c static int lm3533_set_boost_ovp(struct lm3533 *lm3533, lm3533 155 drivers/mfd/lm3533-core.c ret = lm3533_update(lm3533, LM3533_REG_BOOST_PWM, lm3533 159 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to set boost ovp\n"); lm3533 167 drivers/mfd/lm3533-core.c static int lm3533_set_hvled_config(struct lm3533 *lm3533, u8 hvled, u8 bl) lm3533 184 drivers/mfd/lm3533-core.c ret = lm3533_update(lm3533, LM3533_REG_OUTPUT_CONF1, val, mask); lm3533 186 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to set hvled config\n"); lm3533 194 drivers/mfd/lm3533-core.c static int lm3533_set_lvled_config(struct lm3533 *lm3533, u8 lvled, u8 led) lm3533 219 drivers/mfd/lm3533-core.c ret = lm3533_update(lm3533, reg, val, mask); lm3533 221 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to set lvled config\n"); lm3533 226 drivers/mfd/lm3533-core.c static void lm3533_enable(struct lm3533 *lm3533) lm3533 228 drivers/mfd/lm3533-core.c if (gpio_is_valid(lm3533->gpio_hwen)) lm3533 229 drivers/mfd/lm3533-core.c gpio_set_value(lm3533->gpio_hwen, 1); lm3533 232 drivers/mfd/lm3533-core.c static void lm3533_disable(struct lm3533 *lm3533) lm3533 234 drivers/mfd/lm3533-core.c if (gpio_is_valid(lm3533->gpio_hwen)) lm3533 235 drivers/mfd/lm3533-core.c gpio_set_value(lm3533->gpio_hwen, 0); lm3533 259 drivers/mfd/lm3533-core.c struct lm3533 *lm3533 = dev_get_drvdata(dev); lm3533 283 drivers/mfd/lm3533-core.c ret = lm3533_read(lm3533, reg, &val); lm3533 296 drivers/mfd/lm3533-core.c struct lm3533 *lm3533 = dev_get_drvdata(dev); lm3533 306 drivers/mfd/lm3533-core.c ret = lm3533_set_hvled_config(lm3533, id, val); lm3533 308 drivers/mfd/lm3533-core.c ret = lm3533_set_lvled_config(lm3533, id, val); lm3533 362 drivers/mfd/lm3533-core.c struct lm3533 *lm3533 = dev_get_drvdata(dev); lm3533 368 drivers/mfd/lm3533-core.c if (!lm3533->have_backlights && type == LM3533_ATTR_TYPE_BACKLIGHT) lm3533 370 drivers/mfd/lm3533-core.c else if (!lm3533->have_leds && type == LM3533_ATTR_TYPE_LED) lm3533 381 drivers/mfd/lm3533-core.c static int lm3533_device_als_init(struct lm3533 *lm3533) lm3533 383 drivers/mfd/lm3533-core.c struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); lm3533 392 drivers/mfd/lm3533-core.c ret = mfd_add_devices(lm3533->dev, 0, lm3533_als_devs, 1, NULL, lm3533 395 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to add ALS device\n"); lm3533 399 drivers/mfd/lm3533-core.c lm3533->have_als = 1; lm3533 404 drivers/mfd/lm3533-core.c static int lm3533_device_bl_init(struct lm3533 *lm3533) lm3533 406 drivers/mfd/lm3533-core.c struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); lm3533 421 drivers/mfd/lm3533-core.c ret = mfd_add_devices(lm3533->dev, 0, lm3533_bl_devs, lm3533 424 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to add backlight devices\n"); lm3533 428 drivers/mfd/lm3533-core.c lm3533->have_backlights = 1; lm3533 433 drivers/mfd/lm3533-core.c static int lm3533_device_led_init(struct lm3533 *lm3533) lm3533 435 drivers/mfd/lm3533-core.c struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); lm3533 450 drivers/mfd/lm3533-core.c ret = mfd_add_devices(lm3533->dev, 0, lm3533_led_devs, lm3533 453 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to add LED devices\n"); lm3533 457 drivers/mfd/lm3533-core.c lm3533->have_leds = 1; lm3533 462 drivers/mfd/lm3533-core.c static int lm3533_device_setup(struct lm3533 *lm3533, lm3533 467 drivers/mfd/lm3533-core.c ret = lm3533_set_boost_freq(lm3533, pdata->boost_freq); lm3533 471 drivers/mfd/lm3533-core.c return lm3533_set_boost_ovp(lm3533, pdata->boost_ovp); lm3533 474 drivers/mfd/lm3533-core.c static int lm3533_device_init(struct lm3533 *lm3533) lm3533 476 drivers/mfd/lm3533-core.c struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); lm3533 479 drivers/mfd/lm3533-core.c dev_dbg(lm3533->dev, "%s\n", __func__); lm3533 482 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "no platform data\n"); lm3533 486 drivers/mfd/lm3533-core.c lm3533->gpio_hwen = pdata->gpio_hwen; lm3533 488 drivers/mfd/lm3533-core.c dev_set_drvdata(lm3533->dev, lm3533); lm3533 490 drivers/mfd/lm3533-core.c if (gpio_is_valid(lm3533->gpio_hwen)) { lm3533 491 drivers/mfd/lm3533-core.c ret = devm_gpio_request_one(lm3533->dev, lm3533->gpio_hwen, lm3533 494 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, lm3533 496 drivers/mfd/lm3533-core.c lm3533->gpio_hwen); lm3533 501 drivers/mfd/lm3533-core.c lm3533_enable(lm3533); lm3533 503 drivers/mfd/lm3533-core.c ret = lm3533_device_setup(lm3533, pdata); lm3533 507 drivers/mfd/lm3533-core.c lm3533_device_als_init(lm3533); lm3533 508 drivers/mfd/lm3533-core.c lm3533_device_bl_init(lm3533); lm3533 509 drivers/mfd/lm3533-core.c lm3533_device_led_init(lm3533); lm3533 511 drivers/mfd/lm3533-core.c ret = sysfs_create_group(&lm3533->dev->kobj, &lm3533_attribute_group); lm3533 513 drivers/mfd/lm3533-core.c dev_err(lm3533->dev, "failed to create sysfs attributes\n"); lm3533 520 drivers/mfd/lm3533-core.c mfd_remove_devices(lm3533->dev); lm3533 522 drivers/mfd/lm3533-core.c lm3533_disable(lm3533); lm3533 527 drivers/mfd/lm3533-core.c static void lm3533_device_exit(struct lm3533 *lm3533) lm3533 529 drivers/mfd/lm3533-core.c dev_dbg(lm3533->dev, "%s\n", __func__); lm3533 531 drivers/mfd/lm3533-core.c sysfs_remove_group(&lm3533->dev->kobj, &lm3533_attribute_group); lm3533 533 drivers/mfd/lm3533-core.c mfd_remove_devices(lm3533->dev); lm3533 534 drivers/mfd/lm3533-core.c lm3533_disable(lm3533); lm3533 590 drivers/mfd/lm3533-core.c struct lm3533 *lm3533; lm3533 594 drivers/mfd/lm3533-core.c lm3533 = devm_kzalloc(&i2c->dev, sizeof(*lm3533), GFP_KERNEL); lm3533 595 drivers/mfd/lm3533-core.c if (!lm3533) lm3533 598 drivers/mfd/lm3533-core.c i2c_set_clientdata(i2c, lm3533); lm3533 600 drivers/mfd/lm3533-core.c lm3533->regmap = devm_regmap_init_i2c(i2c, ®map_config); lm3533 601 drivers/mfd/lm3533-core.c if (IS_ERR(lm3533->regmap)) lm3533 602 drivers/mfd/lm3533-core.c return PTR_ERR(lm3533->regmap); lm3533 604 drivers/mfd/lm3533-core.c lm3533->dev = &i2c->dev; lm3533 605 drivers/mfd/lm3533-core.c lm3533->irq = i2c->irq; lm3533 607 drivers/mfd/lm3533-core.c return lm3533_device_init(lm3533); lm3533 612 drivers/mfd/lm3533-core.c struct lm3533 *lm3533 = i2c_get_clientdata(i2c); lm3533 616 drivers/mfd/lm3533-core.c lm3533_device_exit(lm3533); lm3533 42 drivers/mfd/lm3533-ctrlbank.c ret = lm3533_update(cb->lm3533, LM3533_REG_CTRLBANK_ENABLE, lm3533 59 drivers/mfd/lm3533-ctrlbank.c ret = lm3533_update(cb->lm3533, LM3533_REG_CTRLBANK_ENABLE, 0, mask); lm3533 84 drivers/mfd/lm3533-ctrlbank.c ret = lm3533_write(cb->lm3533, reg, val); lm3533 102 drivers/mfd/lm3533-ctrlbank.c ret = lm3533_write(cb->lm3533, reg, val); \ lm3533 117 drivers/mfd/lm3533-ctrlbank.c ret = lm3533_read(cb->lm3533, reg, val); \ lm3533 27 drivers/video/backlight/lm3533_bl.c struct lm3533 *lm3533; lm3533 97 drivers/video/backlight/lm3533_bl.c ret = lm3533_read(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, &val); lm3533 128 drivers/video/backlight/lm3533_bl.c ret = lm3533_update(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, val, lm3533 145 drivers/video/backlight/lm3533_bl.c ret = lm3533_read(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, &val); lm3533 179 drivers/video/backlight/lm3533_bl.c ret = lm3533_update(bl->lm3533, LM3533_REG_CTRLBANK_AB_BCONF, val, lm3533 244 drivers/video/backlight/lm3533_bl.c if (!bl->lm3533->have_als) lm3533 270 drivers/video/backlight/lm3533_bl.c struct lm3533 *lm3533; lm3533 279 drivers/video/backlight/lm3533_bl.c lm3533 = dev_get_drvdata(pdev->dev.parent); lm3533 280 drivers/video/backlight/lm3533_bl.c if (!lm3533) lm3533 298 drivers/video/backlight/lm3533_bl.c bl->lm3533 = lm3533; lm3533 301 drivers/video/backlight/lm3533_bl.c bl->cb.lm3533 = lm3533; lm3533 35 include/linux/mfd/lm3533.h struct lm3533 *lm3533; lm3533 96 include/linux/mfd/lm3533.h extern int lm3533_read(struct lm3533 *lm3533, u8 reg, u8 *val); lm3533 97 include/linux/mfd/lm3533.h extern int lm3533_write(struct lm3533 *lm3533, u8 reg, u8 val); lm3533 98 include/linux/mfd/lm3533.h extern int lm3533_update(struct lm3533 *lm3533, u8 reg, u8 val, u8 mask);