From patchwork Thu Oct 11 16:51:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 148661 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2359034lji; Thu, 11 Oct 2018 09:52:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV63406pqWhnmutR4aw4pVNpvp4NsSt8huSQBRYsO8uXif8K27Svh6uag7HbwTSRepq1OrM4Q X-Received: by 2002:a63:8b43:: with SMTP id j64-v6mr2117241pge.149.1539276728761; Thu, 11 Oct 2018 09:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539276728; cv=none; d=google.com; s=arc-20160816; b=RO2IPkynihw033fcOfuybhxIbpF+MMgLY5rNMtqr2/CxQRF3rxcYRJFaH51yewv4rh crxwVlrUHUGkyKTYO7/RwOIFdOa8h+tmEsg7/EWVikNpIrIdwKoNqy45eROaG1KUTx+A zTX1CIf/EA3Zp9C1z93gpdNh7rOdyiY5lfs6RPr6n14rtrO9u7R/HSKJ1j1OyjBuETmm 8KAoOiOF+GeIAA1VwAG5Gx+hXb+KEFvF3L1oyWaDIbNDHNIlC1u8XaH+Fo46g6VAAGJy /oSQjTHyjXuk4jeDU+Hs3kCfBYpdz6ozUl0mipYdfNQ0z96vSFZfHpioPve5ap+KOxWg DM1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=VC7TZuguLI9ukAtsC+n84IBWmdqPgQyyeU+b3me6o5A=; b=vRK1WwayN6tqr0SqYLSIeWg+fhzzNWQrJKvhJwftYqKPBNL0EJuO6hePCej5ETqWA3 bcX0Zx1u/EFOtdBanm/IRHxy6JdEjLO2YZOP7VEcJlWkQEBkyWbGJxj0SlBSZ4kPbCIL tV/alMXpDJp4j+wOjkPXFp4JjnrHZHycZ3JehGmqgiu/RphkZ55MjvrqOS6T1Kp0cE6K 08ElnLJltrlnr+hDhiEmBxW3WQmXWJPjsNDsEstwHlyFaHyJiiqM5ajZ2pikcNbQEvth +u0A6BtOTl1Q3x8/K+slzZY+HjtjVCFv1zJ2hhFptgivUz7N6AFX4Z3CyGnTxRf/LUWs eyEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CBG2w3s3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si27901655pls.118.2018.10.11.09.52.08; Thu, 11 Oct 2018 09:52:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CBG2w3s3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730706AbeJLATk (ORCPT + 32 others); Thu, 11 Oct 2018 20:19:40 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:49800 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730556AbeJLATi (ORCPT ); Thu, 11 Oct 2018 20:19:38 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9BGpT6C076264; Thu, 11 Oct 2018 11:51:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539276689; bh=VC7TZuguLI9ukAtsC+n84IBWmdqPgQyyeU+b3me6o5A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CBG2w3s3z7FPrAuBokTjHrFgw0/FAROkPXR32HwW8vyvaZLQFNWV0sU2EhVi5F8uf 2uCiiViQ7hELqlN+g2zcdo7B/8+7N8EHUWBG1DuquI2IEmwp2HTozW9AeufPWmCJMa v68AJrZQaJQA6oLuAkFOqYT6xo3EjxcNQxPdbm5c= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGpTvo026822; Thu, 11 Oct 2018 11:51:29 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 11 Oct 2018 11:51:29 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 11 Oct 2018 11:51:29 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGpTAl029911; Thu, 11 Oct 2018 11:51:29 -0500 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.172.124]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w9BGpSx20811; Thu, 11 Oct 2018 11:51:29 -0500 (CDT) From: Dan Murphy To: , , CC: , , , , , Dan Murphy Subject: [PATCH v3 5/9] leds: lm3697: Introduce the lm3697 driver Date: Thu, 11 Oct 2018 11:51:19 -0500 Message-ID: <20181011165123.32198-6-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20181011165123.32198-1-dmurphy@ti.com> References: <20181011165123.32198-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce the lm3697 LED driver for backlighting and display. Datasheet location: http://www.ti.com/lit/ds/symlink/lm3697.pdf Signed-off-by: Dan Murphy --- drivers/leds/Kconfig | 8 +- drivers/leds/Makefile | 1 + drivers/leds/leds-lm3697.c | 381 +++++++++++++++++++++++++++++++++++++ 3 files changed, 389 insertions(+), 1 deletion(-) create mode 100644 drivers/leds/leds-lm3697.c -- 2.19.0 diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 853014dbb1c2..7d9a98044be4 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -756,9 +756,15 @@ config LEDS_NIC78BX To compile this driver as a module, choose M here: the module will be called leds-nic78bx. +config LEDS_LM3697 + tristate "LED driver for LM3697" + depends on LEDS_TI_LMU_COMMON + help + Say Y to enable the LED driver for TI LMU devices. + This supports the LED device LM3697. + config LEDS_TI_LMU_COMMON tristate "LED driver for TI LMU" - depends on REGMAP help Say Y to enable the LED driver for TI LMU devices. This supports common features between the TI LM3532, LM3631, LM3632, diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index e09bb27bc7ea..6fbce7cfc41c 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile @@ -78,6 +78,7 @@ obj-$(CONFIG_LEDS_MT6323) += leds-mt6323.o obj-$(CONFIG_LEDS_LM3692X) += leds-lm3692x.o obj-$(CONFIG_LEDS_SC27XX_BLTC) += leds-sc27xx-bltc.o obj-$(CONFIG_LEDS_LM3601X) += leds-lm3601x.o +obj-$(CONFIG_LEDS_LM3697) += leds-lm3697.o obj-$(CONFIG_LEDS_TI_LMU_COMMON) += ti-lmu-led-common.o # LED SPI Drivers diff --git a/drivers/leds/leds-lm3697.c b/drivers/leds/leds-lm3697.c new file mode 100644 index 000000000000..1ed724fb0c43 --- /dev/null +++ b/drivers/leds/leds-lm3697.c @@ -0,0 +1,381 @@ +// SPDX-License-Identifier: GPL-2.0 +// TI LM3697 LED chip family driver +// Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + +#include +#include +#include +#include +#include + +#define LM3697_REV 0x0 +#define LM3697_RESET 0x1 +#define LM3697_OUTPUT_CONFIG 0x10 +#define LM3697_CTRL_A_RAMP 0x11 +#define LM3697_CTRL_B_RAMP 0x12 +#define LM3697_CTRL_A_B_RT_RAMP 0x13 +#define LM3697_CTRL_A_B_RAMP_CFG 0x14 +#define LM3697_CTRL_A_B_BRT_CFG 0x16 +#define LM3697_CTRL_A_FS_CURR_CFG 0x17 +#define LM3697_CTRL_B_FS_CURR_CFG 0x18 +#define LM3697_PWM_CFG 0x1c +#define LM3697_CTRL_A_BRT_LSB 0x20 +#define LM3697_CTRL_A_BRT_MSB 0x21 +#define LM3697_CTRL_B_BRT_LSB 0x22 +#define LM3697_CTRL_B_BRT_MSB 0x23 +#define LM3697_CTRL_ENABLE 0x24 + +#define LM3697_SW_RESET BIT(0) + +#define LM3697_CTRL_A_EN BIT(0) +#define LM3697_CTRL_B_EN BIT(1) +#define LM3697_CTRL_A_B_EN (LM3697_CTRL_A_EN | LM3697_CTRL_B_EN) + +#define LM3697_MAX_LED_STRINGS 3 + +#define LM3697_CONTROL_A 0 +#define LM3697_CONTROL_B 1 +#define LM3697_MAX_CONTROL_BANKS 2 + +#define LM3697_HVLED_ASSIGNMENT 1 + +/** + * struct lm3697_led - + * @hvled_strings: Array of LED strings associated with a control bank + * @label: LED label + * @led_dev: LED class device + * @priv: Pointer to the device struct + * @lmu_data: Register and setting values for common code + * @control_bank: Control bank the LED is associated to. 0 is control bank A + * 1 is control bank B + */ +struct lm3697_led { + u32 hvled_strings[LM3697_MAX_LED_STRINGS]; + char label[LED_MAX_NAME_SIZE]; + struct led_classdev led_dev; + struct lm3697 *priv; + struct ti_lmu_bank lmu_data; + int control_bank; +}; + +/** + * struct lm3697 - + * @enable_gpio: Hardware enable gpio + * @regulator: LED supply regulator pointer + * @client: Pointer to the I2C client + * @regmap: Devices register map + * @dev: Pointer to the devices device struct + * @lock: Lock for reading/writing the device + * @leds: Array of LED strings + */ +struct lm3697 { + struct gpio_desc *enable_gpio; + struct regulator *regulator; + struct i2c_client *client; + struct regmap *regmap; + struct device *dev; + struct mutex lock; + struct lm3697_led leds[]; +}; + +static const struct reg_default lm3697_reg_defs[] = { + {LM3697_OUTPUT_CONFIG, 0x6}, + {LM3697_CTRL_A_RAMP, 0x0}, + {LM3697_CTRL_B_RAMP, 0x0}, + {LM3697_CTRL_A_B_RT_RAMP, 0x0}, + {LM3697_CTRL_A_B_RAMP_CFG, 0x0}, + {LM3697_CTRL_A_B_BRT_CFG, 0x0}, + {LM3697_CTRL_A_FS_CURR_CFG, 0x13}, + {LM3697_CTRL_B_FS_CURR_CFG, 0x13}, + {LM3697_PWM_CFG, 0xc}, + {LM3697_CTRL_A_BRT_LSB, 0x0}, + {LM3697_CTRL_A_BRT_MSB, 0x0}, + {LM3697_CTRL_B_BRT_LSB, 0x0}, + {LM3697_CTRL_B_BRT_MSB, 0x0}, + {LM3697_CTRL_ENABLE, 0x0}, +}; + +static const struct regmap_config lm3697_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + + .max_register = LM3697_CTRL_ENABLE, + .reg_defaults = lm3697_reg_defs, + .num_reg_defaults = ARRAY_SIZE(lm3697_reg_defs), + .cache_type = REGCACHE_FLAT, +}; + +static int lm3697_brightness_set(struct led_classdev *led_cdev, + enum led_brightness brt_val) +{ + struct lm3697_led *led = container_of(led_cdev, struct lm3697_led, + led_dev); + int ctrl_en_val; + int ret; + + mutex_lock(&led->priv->lock); + + if (led->control_bank == LM3697_CONTROL_A) { + led->lmu_data.msb_brightness_reg = LM3697_CTRL_A_BRT_MSB; + led->lmu_data.lsb_brightness_reg = LM3697_CTRL_A_BRT_LSB; + ctrl_en_val = LM3697_CTRL_A_EN; + } else { + led->lmu_data.msb_brightness_reg = LM3697_CTRL_B_BRT_MSB; + led->lmu_data.lsb_brightness_reg = LM3697_CTRL_B_BRT_LSB; + ctrl_en_val = LM3697_CTRL_B_EN; + } + + if (brt_val == LED_OFF) + ret = regmap_update_bits(led->priv->regmap, LM3697_CTRL_ENABLE, + ctrl_en_val, ~ctrl_en_val); + else + ret = regmap_update_bits(led->priv->regmap, LM3697_CTRL_ENABLE, + ctrl_en_val, ctrl_en_val); + + ret = ti_lmu_common_set_brightness(&led->lmu_data, brt_val); + if (ret) + dev_err(&led->priv->client->dev, "Cannot write brightness\n"); + + mutex_unlock(&led->priv->lock); + return ret; +} + +static int lm3697_set_control_bank(struct lm3697 *priv) +{ + u8 control_bank_config = 0; + struct lm3697_led *led; + int ret, i; + + led = &priv->leds[0]; + if (led->control_bank == LM3697_CONTROL_A) + led = &priv->leds[1]; + + for (i = 0; i < LM3697_MAX_LED_STRINGS; i++) + if (led->hvled_strings[i] == LM3697_HVLED_ASSIGNMENT) + control_bank_config |= 1 << i; + + ret = regmap_write(priv->regmap, LM3697_OUTPUT_CONFIG, + control_bank_config); + if (ret) + dev_err(&priv->client->dev, "Cannot write OUTPUT config\n"); + + return ret; +} + +static int lm3697_init(struct lm3697 *priv) +{ + struct lm3697_led *led; + int i, ret; + + if (priv->enable_gpio) { + gpiod_direction_output(priv->enable_gpio, 1); + } else { + ret = regmap_write(priv->regmap, LM3697_RESET, LM3697_SW_RESET); + if (ret) { + dev_err(&priv->client->dev, "Cannot reset the device\n"); + goto out; + } + } + + ret = regmap_write(priv->regmap, LM3697_CTRL_ENABLE, 0x0); + if (ret) { + dev_err(&priv->client->dev, "Cannot write ctrl enable\n"); + goto out; + } + + ret = lm3697_set_control_bank(priv); + if (ret) + dev_err(&priv->client->dev, "Setting the CRTL bank failed\n"); + + for (i = 0; i < LM3697_MAX_CONTROL_BANKS; i++) { + led = &priv->leds[i]; + ti_lmu_common_set_ramp(&led->lmu_data); + if (ret) + dev_err(&priv->client->dev, "Setting the ramp rate failed\n"); + } +out: + return ret; +} + +static int lm3697_probe_dt(struct lm3697 *priv) +{ + struct fwnode_handle *child = NULL; + struct lm3697_led *led; + const char *name; + int control_bank; + size_t i = 0; + int ret; + + priv->enable_gpio = devm_gpiod_get_optional(&priv->client->dev, + "enable", GPIOD_OUT_LOW); + if (IS_ERR(priv->enable_gpio)) { + ret = PTR_ERR(priv->enable_gpio); + dev_err(&priv->client->dev, "Failed to get enable gpio: %d\n", + ret); + return ret; + } + + priv->regulator = devm_regulator_get(&priv->client->dev, "vled"); + if (IS_ERR(priv->regulator)) + priv->regulator = NULL; + + device_for_each_child_node(priv->dev, child) { + ret = fwnode_property_read_u32(child, "reg", &control_bank); + if (ret) { + dev_err(&priv->client->dev, "reg property missing\n"); + fwnode_handle_put(child); + goto child_out; + } + + if (control_bank > LM3697_CONTROL_B) { + dev_err(&priv->client->dev, "reg property is invalid\n"); + ret = -EINVAL; + fwnode_handle_put(child); + goto child_out; + } + + led = &priv->leds[i]; + + led->control_bank = control_bank; + led->lmu_data.bank_id = control_bank; + led->lmu_data.enable_reg = LM3697_CTRL_ENABLE; + led->lmu_data.regmap = priv->regmap; + if (control_bank == LM3697_CONTROL_A) + led->lmu_data.runtime_ramp_reg = LM3697_CTRL_A_RAMP; + else + led->lmu_data.runtime_ramp_reg = LM3697_CTRL_B_RAMP; + + ret = fwnode_property_read_u32_array(child, "led-sources", + led->hvled_strings, + LM3697_MAX_LED_STRINGS); + if (ret) { + dev_err(&priv->client->dev, "led-sources property missing\n"); + fwnode_handle_put(child); + goto child_out; + } + + ret = ti_lmu_common_get_ramp_params(&priv->client->dev, child, &led->lmu_data); + if (ret) + dev_warn(&priv->client->dev, "runtime-ramp properties missing\n"); + + fwnode_property_read_string(child, "linux,default-trigger", + &led->led_dev.default_trigger); + + ret = fwnode_property_read_string(child, "label", &name); + if (ret) + snprintf(led->label, sizeof(led->label), + "%s::", priv->client->name); + else + snprintf(led->label, sizeof(led->label), + "%s:%s", priv->client->name, name); + + led->priv = priv; + led->led_dev.name = led->label; + led->led_dev.brightness_set_blocking = lm3697_brightness_set; + + ret = devm_led_classdev_register(priv->dev, &led->led_dev); + if (ret) { + dev_err(&priv->client->dev, "led register err: %d\n", + ret); + fwnode_handle_put(child); + goto child_out; + } + + i++; + } + +child_out: + return ret; +} + +static int lm3697_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct lm3697 *led; + int count; + int ret; + + count = device_get_child_node_count(&client->dev); + if (!count) { + dev_err(&client->dev, "LEDs are not defined in device tree!"); + return -ENODEV; + } + + led = devm_kzalloc(&client->dev, struct_size(led, leds, count), + GFP_KERNEL); + if (!led) + return -ENOMEM; + + mutex_init(&led->lock); + i2c_set_clientdata(client, led); + + led->client = client; + led->dev = &client->dev; + led->regmap = devm_regmap_init_i2c(client, &lm3697_regmap_config); + if (IS_ERR(led->regmap)) { + ret = PTR_ERR(led->regmap); + dev_err(&client->dev, "Failed to allocate register map: %d\n", + ret); + return ret; + } + + ret = lm3697_probe_dt(led); + if (ret) + return ret; + + return lm3697_init(led); +} + +static int lm3697_remove(struct i2c_client *client) +{ + struct lm3697 *led = i2c_get_clientdata(client); + int ret; + + ret = regmap_update_bits(led->regmap, LM3697_CTRL_ENABLE, + LM3697_CTRL_A_B_EN, 0); + if (ret) { + dev_err(&led->client->dev, "Failed to disable the device\n"); + return ret; + } + + if (led->enable_gpio) + gpiod_direction_output(led->enable_gpio, 0); + + if (led->regulator) { + ret = regulator_disable(led->regulator); + if (ret) + dev_err(&led->client->dev, + "Failed to disable regulator\n"); + } + + mutex_destroy(&led->lock); + + return 0; +} + +static const struct i2c_device_id lm3697_id[] = { + { "lm3697", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, lm3697_id); + +static const struct of_device_id of_lm3697_leds_match[] = { + { .compatible = "ti,lm3697", }, + {}, +}; +MODULE_DEVICE_TABLE(of, of_lm3697_leds_match); + +static struct i2c_driver lm3697_driver = { + .driver = { + .name = "lm3697", + .of_match_table = of_lm3697_leds_match, + }, + .probe = lm3697_probe, + .remove = lm3697_remove, + .id_table = lm3697_id, +}; +module_i2c_driver(lm3697_driver); + +MODULE_DESCRIPTION("Texas Instruments LM3697 LED driver"); +MODULE_AUTHOR("Dan Murphy "); +MODULE_LICENSE("GPL v2"); From patchwork Thu Oct 11 16:51:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 148663 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2359403lji; Thu, 11 Oct 2018 09:52:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ckwTH6/r13f5zfKBnGIOji2U8M7M/ZaGyLYjTjIB7KiFFmaX0C6M+M7Vg37YQRbIVH+m3 X-Received: by 2002:a63:e70a:: with SMTP id b10-v6mr2026691pgi.363.1539276754296; Thu, 11 Oct 2018 09:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539276754; cv=none; d=google.com; s=arc-20160816; b=dtd6qpgQnFIqIaRThBzg5QcrYj9XEru2AunRtSahN4JXzZQgp4ghcEN0yyuecRsC15 6uuoulLS4CUufZPEteK9jA3TQksoPn6ykoKFXFixk1QAPAKmSKf7X2eAUiExoinZzd0B q6L2AnTZ+nhqwdJJ8Bp0nJUlsSN8FDQvfECPuki9+k0uFNBJLSsVxvBRw2MrggEgt9Yt 4rBLsxDFxcgMXSaSZXHcprFb2Sij9ZUdT+GNCIbcHw1PSuDeSF4jM3kzhx4VBbOcbYFt zJcNoI6AmmmmKQW/LqQ90A3FdBi9pMAhJlJ8LLuD0n65pE4w6VFltHqvSAUw4Soa2ecZ bB2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=uD8MpIhrDu4ov4RrqAi+Rgt0Wx3BG3QN/xvG6j4SP7o=; b=PjFb11WFOwQG+HOXRPSjjePbXnSNupWlNnXPFzs6MfGug1+iaXSFSHFE/MWaAldo1O 2WBPP6MqPLY4MOpcyXr1mC7CSMdXLi5tyc9pWGWuyWzWSS0qVGd89/rxJlxV5j7B5K/L xaVYLlF/ntNOgB5XW7rEpSfGbgtrtci3kkNVrHJTpBt3/dRzgfypAp8O2LCZR103F51l GhYAJxpeTEgVDfk0sXhkSNHVgeNDgDgjQwC/rehCB98BSZYO2CCXVQ3N4ZopvIeRjGME hwcYhJO+4ZN0Q04ughTOO4iiugUDsmFD9+JEs+2+e08eQpmap5YGQeTwYhVL2vOiJBYE 6nUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DTaqCfhk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u189-v6si31882915pfu.263.2018.10.11.09.52.34; Thu, 11 Oct 2018 09:52:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DTaqCfhk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730934AbeJLAUf (ORCPT + 32 others); Thu, 11 Oct 2018 20:20:35 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:49794 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730547AbeJLATi (ORCPT ); Thu, 11 Oct 2018 20:19:38 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9BGpUV2076269; Thu, 11 Oct 2018 11:51:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539276690; bh=uD8MpIhrDu4ov4RrqAi+Rgt0Wx3BG3QN/xvG6j4SP7o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=DTaqCfhk+/7JZclvWk1dtayP0XTVK0XAoSWY8e0xSFIGJ2o1qIEbCOcVdz9I8damI XDGkUiOSbaXeyEePzxfTTCLVsXIBS4dJnZBMA+otYyigpUA21t9ih4nLRe/Mr5Np9W sgl1APrVIJPliyd/Ie89NuZ7uXYsfKmpZD5KhLlg= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGpUrk026836; Thu, 11 Oct 2018 11:51:30 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 11 Oct 2018 11:51:30 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 11 Oct 2018 11:51:29 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGpTT4032594; Thu, 11 Oct 2018 11:51:29 -0500 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.172.124]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w9BGpTx20815; Thu, 11 Oct 2018 11:51:29 -0500 (CDT) From: Dan Murphy To: , , CC: , , , , , Dan Murphy Subject: [PATCH v3 6/9] dt-bindings: ti-lmu: Remove LM3633 Date: Thu, 11 Oct 2018 11:51:20 -0500 Message-ID: <20181011165123.32198-7-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20181011165123.32198-1-dmurphy@ti.com> References: <20181011165123.32198-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove support for the LM3633 LED device from the ti-lmu. The LM3633 will be supported via a stand alone LED driver. Signed-off-by: Dan Murphy --- .../devicetree/bindings/mfd/ti-lmu.txt | 48 ------------------- 1 file changed, 48 deletions(-) -- 2.19.0 diff --git a/Documentation/devicetree/bindings/mfd/ti-lmu.txt b/Documentation/devicetree/bindings/mfd/ti-lmu.txt index 920f910be4e9..573e88578d3d 100644 --- a/Documentation/devicetree/bindings/mfd/ti-lmu.txt +++ b/Documentation/devicetree/bindings/mfd/ti-lmu.txt @@ -7,7 +7,6 @@ TI LMU driver supports lighting devices below. LM3532 Backlight LM3631 Backlight and regulator LM3632 Backlight and regulator - LM3633 Backlight, LED and fault monitor LM3695 Backlight Required properties: @@ -15,12 +14,10 @@ Required properties: "ti,lm3532" "ti,lm3631" "ti,lm3632" - "ti,lm3633" "ti,lm3695" - reg: I2C slave address. 0x11 for LM3632 0x29 for LM3631 - 0x36 for LM3633 0x38 for LM3532 0x63 for LM3695 @@ -157,51 +154,6 @@ lm3632@11 { }; }; -lm3633@36 { - compatible = "ti,lm3633"; - reg = <0x36>; - - enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>; - - backlight { - compatible = "ti,lm3633-backlight"; - - main { - label = "main_lcd"; - led-sources = <1 2>; - ramp-up-msec = <500>; - ramp-down-msec = <500>; - }; - - front { - label = "front_lcd"; - led-sources = <0>; - ramp-up-msec = <1000>; - ramp-down-msec = <0>; - }; - }; - - leds { - compatible = "ti,lm3633-leds"; - - chan1 { - label = "status"; - led-sources = <1>; - led-max-microamp = <6000>; - }; - - chan345 { - label = "rgb"; - led-sources = <3 4 5>; - led-max-microamp = <10000>; - }; - }; - - fault-monitor { - compatible = "ti,lm3633-fault-monitor"; - }; -}; - lm3695@63 { compatible = "ti,lm3695"; reg = <0x63>; From patchwork Thu Oct 11 16:51:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 148657 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2358567lji; Thu, 11 Oct 2018 09:51:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV60q8+BQEl7p+qxE67hNGFlzpbrst3dqRXwRvQ0y49kEPw2A0ONaI4uj3wOo2MAcVPndcA15 X-Received: by 2002:a63:4a64:: with SMTP id j36-v6mr2119903pgl.168.1539276701264; Thu, 11 Oct 2018 09:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539276701; cv=none; d=google.com; s=arc-20160816; b=HCZH20pbzxGXSgz55twV/kfeCWaZSzNabUCgRqu+KufN7ZVGGE6E7f1NTUa/jcTg53 zvQt8g18f4FaJ3MZd984YjnxB7+wsSZr+fQJrXSdUmvhUYrULXxqeID6ChoE5vqCA5zm 7kmcgtRDDeNp4z/WBZ0vc9c5o5sYPgOeNIQJYxPlsliI11s0Wv7eEXRqORkF5YdpfuVd 458r1699ZDNzfceGUYy7g3NZkHXWW04w9DPRbGi2Frf9NGAexvjUCsMylV474+nW5oXQ jRBooC5hbY5B7oV+FJNn9pPHUUwyDZLX0kijFhV2rZ0vdW0Yh7jV2WbSp/S5lSASqwzV mOGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=l0EbTxtv2IJBLd1aWuj/2+sweimkKU/boggcSbYKGq8=; b=g/zbXaSBBsvNVMiZr/Og8vujDppXgKgou44bNtlOdyEvBk5zUcVsuyyVHthmU6y2MH 6Acr9PvhjTkxRVR0uuIg0rGfFtKWdgq/zNc5UeagGL+rxKhIWeiYj8siHFxKHXRHAMdW I1TLsDaiHI+6c/VSe2AKAw8RiDXH4YGMlcLC6KrsD6666vMk1+tfRmxpAEwPjfqCstER Jga1Ku6U9ZxrqMzTMkjtdjqGrhJYXqr3Cd+Z5pypH11oPGpz02K71Q6KVrFcifpIwY9E pWL6bez0fCnQ5VsNVSu7V+kA/r8iOlcCRDFEpSYNhRyGaaCz6BZfhlQ6Tbo88Ac9mmy+ ySwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jmIVEmvP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13-v6si25343867pgc.119.2018.10.11.09.51.40; Thu, 11 Oct 2018 09:51:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jmIVEmvP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730754AbeJLATk (ORCPT + 32 others); Thu, 11 Oct 2018 20:19:40 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:49802 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730558AbeJLATi (ORCPT ); Thu, 11 Oct 2018 20:19:38 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9BGpVkl076273; Thu, 11 Oct 2018 11:51:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539276691; bh=l0EbTxtv2IJBLd1aWuj/2+sweimkKU/boggcSbYKGq8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jmIVEmvP48fOBhc+e1e2PDUK/BDe2uZCIB4eEJlHLqe8bEuIvihbW1e8ryWrkjolD H46qLRffEnT4kXEhNcKPGUDk3R/VELYRslhRzjIut2KWBuqQM11mpHHqPz1zp7sjGu YM3dS0Rt40I20SHw3+RSGRq4YWPcUCR+oUkjhwH4= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGpUOM026842; Thu, 11 Oct 2018 11:51:30 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 11 Oct 2018 11:51:30 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 11 Oct 2018 11:51:30 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGpUOw032655; Thu, 11 Oct 2018 11:51:30 -0500 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.172.124]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w9BGpUx20819; Thu, 11 Oct 2018 11:51:30 -0500 (CDT) From: Dan Murphy To: , , CC: , , , , , Dan Murphy Subject: [PATCH v3 7/9] mfd: ti-lmu: Remove support for LM3633 Date: Thu, 11 Oct 2018 11:51:21 -0500 Message-ID: <20181011165123.32198-8-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20181011165123.32198-1-dmurphy@ti.com> References: <20181011165123.32198-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove support for the LM3633 from the ti-lmu driver in favor of a dedicated LED driver. Signed-off-by: Dan Murphy --- drivers/mfd/Kconfig | 2 +- drivers/mfd/ti-lmu.c | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) -- 2.19.0 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 9b04dd527c68..225cb3be350c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1293,7 +1293,7 @@ config MFD_TI_LMU help Say yes here to enable support for TI LMU chips. - TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, and LM3695. + TI LMU MFD supports LM3532, LM3631, LM3632, and LM3695. It consists of backlight, LED and regulator driver. It provides consistent device controls for lighting functions. diff --git a/drivers/mfd/ti-lmu.c b/drivers/mfd/ti-lmu.c index b6bfa99a29dd..2cf8a23cba52 100644 --- a/drivers/mfd/ti-lmu.c +++ b/drivers/mfd/ti-lmu.c @@ -102,24 +102,6 @@ static struct mfd_cell lm3632_devices[] = { }, }; -static struct mfd_cell lm3633_devices[] = { - { - .name = "ti-lmu-backlight", - .id = LM3633, - .of_compatible = "ti,lm3633-backlight", - }, - { - .name = "lm3633-leds", - .of_compatible = "ti,lm3633-leds", - }, - /* Monitoring driver for open/short circuit detection */ - { - .name = "ti-lmu-fault-monitor", - .id = LM3633, - .of_compatible = "ti,lm3633-fault-monitor", - }, -}; - static struct mfd_cell lm3695_devices[] = { { .name = "ti-lmu-backlight", @@ -139,14 +121,12 @@ static const struct ti_lmu_data chip##_data = \ TI_LMU_DATA(lm3532, LM3532_MAX_REG); TI_LMU_DATA(lm3631, LM3631_MAX_REG); TI_LMU_DATA(lm3632, LM3632_MAX_REG); -TI_LMU_DATA(lm3633, LM3633_MAX_REG); TI_LMU_DATA(lm3695, LM3695_MAX_REG); static const struct of_device_id ti_lmu_of_match[] = { { .compatible = "ti,lm3532", .data = &lm3532_data }, { .compatible = "ti,lm3631", .data = &lm3631_data }, { .compatible = "ti,lm3632", .data = &lm3632_data }, - { .compatible = "ti,lm3633", .data = &lm3633_data }, { .compatible = "ti,lm3695", .data = &lm3695_data }, { } }; @@ -219,7 +199,6 @@ static const struct i2c_device_id ti_lmu_ids[] = { { "lm3532", LM3532 }, { "lm3631", LM3631 }, { "lm3632", LM3632 }, - { "lm3633", LM3633 }, { "lm3695", LM3695 }, { } };