From patchwork Tue Apr 30 19:17:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 163154 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3626902ill; Tue, 30 Apr 2019 12:17:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOBPLg5dSt3FMTA+fwuCTNiwvi8M1N20vRZCCi0/6yzy+ODw8NFHOAykyie7Uhtw859Tns X-Received: by 2002:aa7:8252:: with SMTP id e18mr15422547pfn.105.1556651861247; Tue, 30 Apr 2019 12:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556651861; cv=none; d=google.com; s=arc-20160816; b=f5+KlY7e9Tgl/0L1D5dc44G7etEhctaidDhdBbnxYahcWLQwPh86Jmf7v5uKnKexBa CtnDw3wMlhlagOVgxBIexdtvAWn8DbW6/7JtrhmWlniurZajz26z7MAhMMaxDDsukxyQ QYKCPknZHcNk586FxM7NX59UJssyUEGdlDuuOFJ4HHPEXGmpyQ8bkluyWJBEcCQ07EJE mWuFKdqoo2F/GlxMLZsrUrWXYIw4YjEz6hk83XrVuR2qbq4Iue04nC/3W+SGWFKZ96Hk 1LBCx9yAFbDlvGomTC+reJFOYXn878EHa4txFx+0IgxuYhfUGfd15jU2tJHDBFlCA5GC 5bmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oIAzHTI5a+s+b5rzRKIA6SvH4UyhyshCDOofvkrccxU=; b=UV3QpKxfDALFuZslo0nS5eo/HfBa4+RGneT35utXDbPre0anVhX1jQTssTsRa/ZYtB UkMWs4aBZZf+jNLlZNq71eQBNAICtHn7vUDZXx093+fivjg5gaLhHT6xRXnqCNhy6q3W HUR4goQpFM2gy8khaLBy/DohPBap6QmyXuUcRRDvcv/zHUOGz2mi4ydOo4rXA/Mjhhvo PPHVihUYVir+QIQOJBnmu2YE3E3caDC4D8U54hf98HLnqU7ZRAp3zEdOuxNdrwFrojhy JgtgaLuSNAbp5BtoDWrWMxHSK66j7rn9xzpXpwyf2bLQqWltkjyuhPDi4GVULsIwU7gz ia8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=zGnwgo8b; 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 b66si26524154pfa.104.2019.04.30.12.17.40; Tue, 30 Apr 2019 12:17: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=zGnwgo8b; 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 S1727179AbfD3TRk (ORCPT + 30 others); Tue, 30 Apr 2019 15:17:40 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:35650 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbfD3TRi (ORCPT ); Tue, 30 Apr 2019 15:17:38 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHY16074213; Tue, 30 Apr 2019 14:17:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556651854; bh=oIAzHTI5a+s+b5rzRKIA6SvH4UyhyshCDOofvkrccxU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=zGnwgo8bXMjs6EkTDv9xo9fF3VRvqJxfL5ebyMNnZ7rPqbdrMMCelyw+7Jrp+ipQA PwRIP4SlVAeiAWx/b5Papk7xMruNKyQuxGo+Sidf7VpVWHu1yabTvvsydbhV+2rSGO 4XO9DRQZ5WXCdrPksiJdaXfguiToAlLjzd4PK8SU= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3UJHYHC005516 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Apr 2019 14:17:34 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) 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.1713.5; Tue, 30 Apr 2019 14:17:33 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 30 Apr 2019 14:17:33 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHXpE007868; Tue, 30 Apr 2019 14:17:33 -0500 From: Dan Murphy To: , CC: , , Dan Murphy , Rob Herring Subject: [PATCH v3 2/7] dt-bindings: mfd: LMU: Add the ramp up/down property Date: Tue, 30 Apr 2019 14:17:25 -0500 Message-ID: <20190430191730.19450-3-dmurphy@ti.com> X-Mailer: git-send-email 2.21.0.5.gaeb582a983 In-Reply-To: <20190430191730.19450-1-dmurphy@ti.com> References: <20190430191730.19450-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 Document the ramp-up and ramp-down property in the binding. Removing the "sec" from the property definition as seconds is implied. Reviewed-by: Rob Herring Signed-off-by: Dan Murphy --- v3 - No changes added Reviewed-by Rob - https://lore.kernel.org/patchwork/patch/1058759/ v2 - Fixed commit message as this was not just a modification but adding documentation https://lore.kernel.org/patchwork/patch/1054504/ .../devicetree/bindings/mfd/ti-lmu.txt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.21.0.5.gaeb582a983 diff --git a/Documentation/devicetree/bindings/mfd/ti-lmu.txt b/Documentation/devicetree/bindings/mfd/ti-lmu.txt index 86ca786d54fc..adae96c79d39 100644 --- a/Documentation/devicetree/bindings/mfd/ti-lmu.txt +++ b/Documentation/devicetree/bindings/mfd/ti-lmu.txt @@ -25,6 +25,12 @@ Required properties: Optional property: - enable-gpios: A GPIO specifier for hardware enable pin. + - ramp-up-ms: Current ramping from one brightness level to + the a higher brightness level. + Range from 2048 us - 117.44 s + - ramp-down-ms: Current ramping from one brightness level to + the a lower brightness level. + Range from 2048 us - 117.44 s Required node: - backlight: All LMU devices have backlight child nodes. @@ -90,7 +96,7 @@ lm3631@29 { lcd_bl { led-sources = <0 1>; - ramp-up-msec = <300>; + ramp-up-ms = <300>; }; }; }; @@ -152,15 +158,15 @@ lm3633@36 { main { label = "main_lcd"; led-sources = <1 2>; - ramp-up-msec = <500>; - ramp-down-msec = <500>; + ramp-up-ms = <500>; + ramp-down-ms = <500>; }; front { label = "front_lcd"; led-sources = <0>; - ramp-up-msec = <1000>; - ramp-down-msec = <0>; + ramp-up-ms = <1000>; + ramp-down-ms = <0>; }; }; @@ -212,8 +218,8 @@ lm3697@36 { lcd { led-sources = <0 1 2>; - ramp-up-msec = <200>; - ramp-down-msec = <200>; + ramp-up-ms = <200>; + ramp-down-ms = <200>; }; }; From patchwork Tue Apr 30 19:17:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 163155 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3626948ill; Tue, 30 Apr 2019 12:17:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzMB5FWVRC+xTxfzzHWVsy/aXaBTBH0J8gmtS6H1psJ1Q/LIFjJTQ+0GfTzkwOokyBHBg5 X-Received: by 2002:a63:de0a:: with SMTP id f10mr58498902pgg.418.1556651863591; Tue, 30 Apr 2019 12:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556651863; cv=none; d=google.com; s=arc-20160816; b=LwazsL9knw4iFrxc+V+GEPaT/3G0y22+r4Si4qtnolxj99bBpC7dTPxCoCxEFG6L5Y um2ZEmRZfYMOP04dGjcl3D504tXxau7LJ3pSAtuZcYgw4HAELDCTWXiL2J1EPN1E1Nm5 eebhXXiAOhnnw3sJ8krNuE/RhQOWXR87tNXTxtW5HIljnGBVRofK7e+mhVNr4A0S4vos Act79kMbsNW0G3wE7ZvdEYxfF6MiV94QiM6NDte7+UDSO3/DOgCPbrmYJBY+mxo2edga mb/nvYQMEe/zA1cZEicR6z06y5w+AVuqJtXpU9G8tnFXT4lu8Eylorjxp993wUgMmSPE 1/aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nMWswNGKHI9bEoXbloOjXa8MbqqJ0sJHFPjUMME4kzA=; b=S87zFN8FfMFZwEDVbVMtGVeU7TIJmcFC98Kw8VAXh08dGidHcHILgoqhCyEk4JAvY1 W4AcHj0wBfaQJjSjTyK5dR7zhBTsLYwYd6edl2mdnUxTRkHmd5BvAeTVojsdOM98/1H4 eClgRV3q7ZogTWAD8DYE3+vCvBLeooo1iY9Jg9tWas/OAlp4+y5vVHq+k4BG+0JMxRct UoRB01itpnT/75q+jHo6uYbq74sQ05lx416UKKwmozh0LD5Je37BmTBFS/4Mhoz7Oh7k 303gIb8YzHQq+TEr5aHPmnpzeTyRp2V7VrgxyJLZy21gxJleFh6ItXmZ7xCnS/E2tDCs wRUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Nvl4e2M0; 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 b66si26524154pfa.104.2019.04.30.12.17.43; Tue, 30 Apr 2019 12:17:43 -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=Nvl4e2M0; 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 S1727268AbfD3TRl (ORCPT + 30 others); Tue, 30 Apr 2019 15:17:41 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:35424 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726916AbfD3TRi (ORCPT ); Tue, 30 Apr 2019 15:17:38 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHY50030560; Tue, 30 Apr 2019 14:17:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556651854; bh=nMWswNGKHI9bEoXbloOjXa8MbqqJ0sJHFPjUMME4kzA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Nvl4e2M0MAz0IdZgvVImnufJjYq9KmgrDqN9C356hMS1bXHDfbHs/4PO+BzpD2Xs4 HDKWKSagdVaHHbJ/Mx7z47M1tkEqCIJTCZlxq14SrvId9aWpniKwWvLmXQudkQF+7+ Zr66P+uK1N2RHWHEoLiFjKy5QakoANyIjJWNEaWU= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3UJHYvh063163 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Apr 2019 14:17:34 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 30 Apr 2019 14:17:34 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 30 Apr 2019 14:17:34 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHY6p007894; Tue, 30 Apr 2019 14:17:34 -0500 From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH v3 4/7] leds: TI LMU: Add common code for TI LMU devices Date: Tue, 30 Apr 2019 14:17:27 -0500 Message-ID: <20190430191730.19450-5-dmurphy@ti.com> X-Mailer: git-send-email 2.21.0.5.gaeb582a983 In-Reply-To: <20190430191730.19450-1-dmurphy@ti.com> References: <20190430191730.19450-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 Create a TI LMU common framework for TI LMU devices that share common features. Currently the runtime ramp and brightness setting have been identified as common features with common register settings. This work is derived from Milo Kims TI LMU MFD code. Acked-by: Pavel Machek Signed-off-by: Dan Murphy --- v3 - No changes - https://lore.kernel.org/patchwork/patch/1058764/ v2 - Added support for the brightness resolution parameter as it is a global parameter for all LMU devices, no other changes were made - https://lore.kernel.org/patchwork/patch/1054500/ drivers/leds/Kconfig | 8 ++ drivers/leds/Makefile | 1 + drivers/leds/ti-lmu-led-common.c | 155 ++++++++++++++++++++++++++++++ include/linux/ti-lmu-led-common.h | 47 +++++++++ 4 files changed, 211 insertions(+) create mode 100644 drivers/leds/ti-lmu-led-common.c create mode 100644 include/linux/ti-lmu-led-common.h -- 2.21.0.5.gaeb582a983 diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index da00b9ed5a5c..3ae24eaf4cde 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -776,6 +776,14 @@ config LEDS_NIC78BX To compile this driver as a module, choose M here: the module will be called leds-nic78bx. +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, + LM3633, LM3695 and LM3697. + comment "LED Triggers" source "drivers/leds/trigger/Kconfig" diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index 7a8b1f55d459..85fd449c002d 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile @@ -80,6 +80,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_TI_LMU_COMMON) += ti-lmu-led-common.o # LED SPI Drivers obj-$(CONFIG_LEDS_CR0014114) += leds-cr0014114.o diff --git a/drivers/leds/ti-lmu-led-common.c b/drivers/leds/ti-lmu-led-common.c new file mode 100644 index 000000000000..8090feac6de4 --- /dev/null +++ b/drivers/leds/ti-lmu-led-common.c @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright 2015 Texas Instruments +// Copyright 2018 Sebastian Reichel +// Copyright 2018 Pavel Machek +// TI LMU LED common framework, based on previous work from +// Milo Kim + +#include +#include +#include + +#include + +const static int ramp_table[16] = { 2, 262, 524, 1049, 2090, 4194, 8389, + 16780, 33550, 41940, 50330, 58720, + 67110, 83880, 100660, 117440}; + +static int ti_lmu_common_update_brightness(struct ti_lmu_bank *lmu_bank, + int brightness) +{ + struct regmap *regmap = lmu_bank->regmap; + u8 reg, val; + int ret; + + /* + * Brightness register update + * + * 11 bit dimming: update LSB bits and write MSB byte. + * MSB brightness should be shifted. + * 8 bit dimming: write MSB byte. + */ + if (lmu_bank->max_brightness == MAX_BRIGHTNESS_11BIT) { + reg = lmu_bank->lsb_brightness_reg; + ret = regmap_update_bits(regmap, reg, + LMU_11BIT_LSB_MASK, + brightness); + if (ret) + return ret; + + val = brightness >> LMU_11BIT_MSB_SHIFT; + } else { + val = brightness; + } + + reg = lmu_bank->msb_brightness_reg; + + return regmap_write(regmap, reg, val); +} + +int ti_lmu_common_set_brightness(struct ti_lmu_bank *lmu_bank, int brightness) +{ + return ti_lmu_common_update_brightness(lmu_bank, brightness); +} +EXPORT_SYMBOL(ti_lmu_common_set_brightness); + +static int ti_lmu_common_convert_ramp_to_index(unsigned int msec) +{ + int size = ARRAY_SIZE(ramp_table); + int i; + + if (msec <= ramp_table[0]) + return 0; + + if (msec > ramp_table[size - 1]) + return size - 1; + + for (i = 1; i < size; i++) { + if (msec == ramp_table[i]) + return i; + + /* Find an approximate index by looking up the table */ + if (msec > ramp_table[i - 1] && msec < ramp_table[i]) { + if (msec - ramp_table[i - 1] < ramp_table[i] - msec) + return i - 1; + else + return i; + } + } + + return -EINVAL; +} + +int ti_lmu_common_set_ramp(struct ti_lmu_bank *lmu_bank) +{ + struct regmap *regmap = lmu_bank->regmap; + u8 ramp, ramp_up, ramp_down; + + if (lmu_bank->ramp_up_msec == 0 && lmu_bank->ramp_down_msec == 0) { + ramp_up = 0; + ramp_down = 0; + } else { + ramp_up = ti_lmu_common_convert_ramp_to_index(lmu_bank->ramp_up_msec); + ramp_down = ti_lmu_common_convert_ramp_to_index(lmu_bank->ramp_down_msec); + } + + if (ramp_up < 0 || ramp_down < 0) + return -EINVAL; + + ramp = (ramp_up << 4) | ramp_down; + + return regmap_write(regmap, lmu_bank->runtime_ramp_reg, ramp); + +} +EXPORT_SYMBOL(ti_lmu_common_set_ramp); + +int ti_lmu_common_get_ramp_params(struct device *dev, + struct fwnode_handle *child, + struct ti_lmu_bank *lmu_data) +{ + int ret; + + ret = fwnode_property_read_u32(child, "ramp-up-ms", + &lmu_data->ramp_up_msec); + if (ret) + dev_warn(dev, "ramp-up-ms property missing\n"); + + + ret = fwnode_property_read_u32(child, "ramp-down-ms", + &lmu_data->ramp_down_msec); + if (ret) + dev_warn(dev, "ramp-down-ms property missing\n"); + + return 0; +} +EXPORT_SYMBOL(ti_lmu_common_get_ramp_params); + +int ti_lmu_common_get_brt_res(struct device *dev, struct fwnode_handle *child, + struct ti_lmu_bank *lmu_data) +{ + int ret; + + ret = device_property_read_u32(dev, "ti,brightness-resolution", + &lmu_data->max_brightness); + if (ret) + ret = fwnode_property_read_u32(child, + "ti,brightness-resolution", + &lmu_data->max_brightness); + if (lmu_data->max_brightness <= 0) { + lmu_data->max_brightness = MAX_BRIGHTNESS_8BIT; + return ret; + } + + if (lmu_data->max_brightness > MAX_BRIGHTNESS_11BIT) + lmu_data->max_brightness = MAX_BRIGHTNESS_11BIT; + + + return 0; +} +EXPORT_SYMBOL(ti_lmu_common_get_brt_res); + +MODULE_DESCRIPTION("TI LMU common LED framework"); +MODULE_AUTHOR("Sebastian Reichel"); +MODULE_AUTHOR("Dan Murphy "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("ti-lmu-led-common"); diff --git a/include/linux/ti-lmu-led-common.h b/include/linux/ti-lmu-led-common.h new file mode 100644 index 000000000000..bed69850a173 --- /dev/null +++ b/include/linux/ti-lmu-led-common.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +// TI LMU Common Core +// Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + +#ifndef _TI_LMU_COMMON_H_ +#define _TI_LMU_COMMON_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define LMU_11BIT_LSB_MASK (BIT(0) | BIT(1) | BIT(2)) +#define LMU_11BIT_MSB_SHIFT 3 + +#define MAX_BRIGHTNESS_8BIT 255 +#define MAX_BRIGHTNESS_11BIT 2047 + +struct ti_lmu_bank { + struct regmap *regmap; + + int max_brightness; + + u8 lsb_brightness_reg; + u8 msb_brightness_reg; + + u8 runtime_ramp_reg; + u32 ramp_up_msec; + u32 ramp_down_msec; +}; + +int ti_lmu_common_set_brightness(struct ti_lmu_bank *lmu_bank, int brightness); + +int ti_lmu_common_set_ramp(struct ti_lmu_bank *lmu_bank); + +int ti_lmu_common_get_ramp_params(struct device *dev, + struct fwnode_handle *child, + struct ti_lmu_bank *lmu_data); + +int ti_lmu_common_get_brt_res(struct device *dev, struct fwnode_handle *child, + struct ti_lmu_bank *lmu_data); + +#endif /* _TI_LMU_COMMON_H_ */ From patchwork Tue Apr 30 19:17:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 163156 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3627127ill; Tue, 30 Apr 2019 12:17:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqymwuoGclQA20xif110ZA0o3f9PPKmtWvbNoOhRarWlPmpM3C8Y6qSSSTMKAjeIN2dg4l7P X-Received: by 2002:a63:ee01:: with SMTP id e1mr57580333pgi.20.1556651871351; Tue, 30 Apr 2019 12:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556651871; cv=none; d=google.com; s=arc-20160816; b=PGTkO88Kdaxuay563TdgJAKw0wgV2pyeobWTcd8ApTcCguyLzDvZIyZ3SOll5h4bif sTiX+JAxgAD3hT4+LcDGHajv0k8pT43FpHN8ka7teRx9RnW6kAL39VBePU7PCT9YUAry mFgo6Sba67bxvSKA7aeW9X5xoNKhUqUUiQx87a8WCUXP89z7EAkPIOTwTgenCUj0FKLu l3fOBSk9hM4MtfcYC+hSjHW9eHWnUf8RjvBVLH6SCEbTnH006ZnofqwKlSrExz4nb2Qk gMGMcmn1oh1sD01ZfERuqXFxsOpwaiMLrfUPgihB+PU7H0acIHy2G1UsfZjolyp1wVC3 fHHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0bwGoJ5xnao/ESMaTulfbdfTNDilcdU0Ylq9OJpFxyI=; b=ryLl5hK4brUoIiSVYKArreS9KRWXw5G+udxPIJpIbRq1/4ge7y2P1SSLC5y51wxbte UI28iLwlfTDngdAIJo73M20ZQDCeUTEcbPY2RRdQ6K9ustHPUypCgqYa8AC6FPqiXeXF 75Fx65B2KMCzf+tPRcQqZF3HgKUXch3u6QaCO3cA+bQL9VcBiFn/uLg526LUCj+c66s/ RF2FQRON00DDlLc3t5wDnDayFxmCfADdcR+6mLWSkw43Ijv4HcQqfkHwFJ1AwEe73YHk WTf73GZjS+R8M1E/36+zvk/vM0g9T1c8r6bKr250tFoYgiyNjPYhY85Y8vbKaL2/ZVlc 4b3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hbc6DPPq; 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 l4si35555352pgp.280.2019.04.30.12.17.50; Tue, 30 Apr 2019 12:17:51 -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=hbc6DPPq; 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 S1727372AbfD3TRt (ORCPT + 30 others); Tue, 30 Apr 2019 15:17:49 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:35662 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbfD3TRk (ORCPT ); Tue, 30 Apr 2019 15:17:40 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHa6l074219; Tue, 30 Apr 2019 14:17:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556651856; bh=0bwGoJ5xnao/ESMaTulfbdfTNDilcdU0Ylq9OJpFxyI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hbc6DPPq+N5tFoOB+xJhXEUyvuRJ3gb4v4ePWSrE1cIhfL19dqcnPZ+sxBh7neZ0G aGSbOzxFQbbNEXucRzh3IQi9yyn07Ad7rADP2P3ptUaJ07AeB6xYdHrwrYQ9C9JENs xJFruG4Ao7knsVg8B2O6zadR9JGgagoZqqo7fx7o= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3UJHavd078557 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Apr 2019 14:17:36 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 30 Apr 2019 14:17:35 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 30 Apr 2019 14:17:35 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHYSF063015; Tue, 30 Apr 2019 14:17:35 -0500 From: Dan Murphy To: , CC: , , Dan Murphy , Rob Herring Subject: [PATCH v3 5/7] dt-bindings: ti-lmu: Modify dt bindings for the LM3697 Date: Tue, 30 Apr 2019 14:17:28 -0500 Message-ID: <20190430191730.19450-6-dmurphy@ti.com> X-Mailer: git-send-email 2.21.0.5.gaeb582a983 In-Reply-To: <20190430191730.19450-1-dmurphy@ti.com> References: <20190430191730.19450-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 The LM3697 is a single function LED driver. The single function LED driver needs to reside in the LED directory as a dedicated LED driver and not as a MFD device. The device does have common brightness and ramp features and those can be accomodated by a TI LMU framework. The LM3697 dt binding needs to be moved from the ti-lmu.txt and a dedicated LED dt binding needs to be added. The new LM3697 LED dt binding will then reside in the Documentation/devicetree/bindings/leds directory and follow the current LED and general bindings guidelines. Reviewed-by: Rob Herring Signed-off-by: Dan Murphy --- v3 - No changes added Reviewed-by Rob - https://lore.kernel.org/patchwork/patch/1058762/ v2 - Made changes to reference ti,brightness-resolution to the ti-lmu.txt - https://lore.kernel.org/patchwork/patch/1054501/ .../devicetree/bindings/leds/leds-lm3697.txt | 73 +++++++++++++++++++ .../devicetree/bindings/mfd/ti-lmu.txt | 27 +------ 2 files changed, 74 insertions(+), 26 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/leds-lm3697.txt -- 2.21.0.5.gaeb582a983 diff --git a/Documentation/devicetree/bindings/leds/leds-lm3697.txt b/Documentation/devicetree/bindings/leds/leds-lm3697.txt new file mode 100644 index 000000000000..02378f33c9ab --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-lm3697.txt @@ -0,0 +1,73 @@ +* Texas Instruments - LM3697 Highly Efficient White LED Driver + +The LM3697 11-bit LED driver provides high- +performance backlight dimming for 1, 2, or 3 series +LED strings while delivering up to 90% efficiency. + +This device is suitable for display and keypad Lighting + +Required properties: + - compatible: + "ti,lm3697" + - reg : I2C slave address + - #address-cells : 1 + - #size-cells : 0 + +Optional properties: + - enable-gpios : GPIO pin to enable/disable the device + - vled-supply : LED supply + +Required child properties: + - reg : 0 - LED is Controlled by bank A + 1 - LED is Controlled by bank B + - led-sources : Indicates which HVLED string is associated to which + control bank. This is a zero based property so + HVLED1 = 0, HVLED2 = 1, HVLED3 = 2. + Additional information is contained + in Documentation/devicetree/bindings/leds/common.txt + +Optional child properties: + - ti,brightness-resolution - see Documentation/devicetree/bindings/mfd/ti-lmu.txt + - ramp-up-ms: see Documentation/devicetree/bindings/mfd/ti-lmu.txt + - ramp-down-ms: see Documentation/devicetree/bindings/mfd/ti-lmu.txt + - label : see Documentation/devicetree/bindings/leds/common.txt + - linux,default-trigger : + see Documentation/devicetree/bindings/leds/common.txt + +Example: + +HVLED string 1 and 3 are controlled by control bank A and HVLED 2 string is +controlled by control bank B. + +led-controller@36 { + compatible = "ti,lm3697"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x36>; + + enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; + vled-supply = <&vbatt>; + + led@0 { + reg = <0>; + led-sources = <0 2>; + ti,brightness-resolution = <2047>; + ramp-up-ms = <5000>; + ramp-down-ms = <1000>; + label = "white:first_backlight_cluster"; + linux,default-trigger = "backlight"; + }; + + led@1 { + reg = <1>; + led-sources = <1>; + ti,brightness-resolution = <255>; + ramp-up-ms = <500>; + ramp-down-ms = <1000>; + label = "white:second_backlight_cluster"; + linux,default-trigger = "backlight"; + }; +} + +For more product information please see the link below: +http://www.ti.com/lit/ds/symlink/lm3697.pdf diff --git a/Documentation/devicetree/bindings/mfd/ti-lmu.txt b/Documentation/devicetree/bindings/mfd/ti-lmu.txt index 5881929d5f7a..a948a8f41b2c 100644 --- a/Documentation/devicetree/bindings/mfd/ti-lmu.txt +++ b/Documentation/devicetree/bindings/mfd/ti-lmu.txt @@ -8,7 +8,6 @@ TI LMU driver supports lighting devices below. LM3632 Backlight and regulator LM3633 Backlight, LED and fault monitor LM3695 Backlight - LM3697 Backlight and fault monitor Required properties: - compatible: Should be one of: @@ -16,11 +15,10 @@ Required properties: "ti,lm3632" "ti,lm3633" "ti,lm3695" - "ti,lm3697" - reg: I2C slave address. 0x11 for LM3632 0x29 for LM3631 - 0x36 for LM3633, LM3697 + 0x36 for LM3633 0x63 for LM3695 Optional property: @@ -51,7 +49,6 @@ Optional nodes: Required properties: - compatible: Should be one of: "ti,lm3633-fault-monitor" - "ti,lm3697-fault-monitor" - leds: LED properties for LM3633. Please refer to [2]. - regulators: Regulator properties for LM3631 and LM3632. Please refer to [3]. @@ -216,25 +213,3 @@ lm3695@63 { }; }; }; - -lm3697@36 { - compatible = "ti,lm3697"; - reg = <0x36>; - - enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>; - - backlight { - compatible = "ti,lm3697-backlight"; - - lcd { - ti,brightness-resolution = <255>; - led-sources = <0 1 2>; - ramp-up-ms = <200>; - ramp-down-ms = <200>; - }; - }; - - fault-monitor { - compatible = "ti,lm3697-fault-monitor"; - }; -}; From patchwork Tue Apr 30 19:17:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 163158 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3627502ill; Tue, 30 Apr 2019 12:18:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl3gDxRLMSL5C32CpEccH+n4MIVOfO6k951Pmz+m6GSUHAsnPK97CYgC3EbPrELrZ83SWS X-Received: by 2002:a62:ed16:: with SMTP id u22mr72022708pfh.47.1556651893443; Tue, 30 Apr 2019 12:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556651893; cv=none; d=google.com; s=arc-20160816; b=sAKdCkk/U/Oyyr5i6BUb16/j7OnV5V7JkmjDWTwvTulkQDgm68sO87KczrYpytOu2P 2f7n0Eo4/YwPRc0wsR0fVqXJ9EQV/S9m3DZ/4I6qWH9pHfAna6iF2Q+dZRnG85FrTxtu PEUtTqo9y79yVIBo3fskTEkCwU1valQiJ+SOjlKN5gUGAgtyeZM5XLfzBQ9ENkqYXkfG agbRl0qBvhTeZ6Y8MUToTn42nDSKIGTy+TGFmyez0XCfPJ7fef1sFiu7WOz05fxec0uk 6SYq235Mow1XAlWgOkN0t2QndY+cp91yxgghl72h8mX82BVxjZnb67Xl9k1S6tG07MIF 9FLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=55aFxS37+ts7a5rVXEuf6vFbFoPDWE7uJGT2pp1DmwQ=; b=T7hI4xs5U7BLKLniACFmaPeMr9epBPhMg1oq3hY0tgeWitJHsi8nlRGRNXRwURUxQA OEKhp6pwBEY9KfDnxkMg+FzrsO51Dw0X2nWXZQuawB6WznsO8Jj5ZIZf22Vnm7wDp4b7 SFJzQanhS9mfi5vIBF3OgXlh18y2r222hIwEdmfJ4o2PeifDgKUcumGRcAP/dY4UkSRV 8NHXiWJpQjeVuVRPNi7HHbkYwIR0sAoZmgsb0LI8JDGOaYfectYNDxnHbBp3MDqWF1cb mCQxMWenFV3/eHeU5YKRKK5GBqGi9IujPROxKKmurnAqE2aRh+M0XPse+/TgHL7jblGh U2QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=F7TIWgjY; 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 gn13si37651624plb.377.2019.04.30.12.18.13; Tue, 30 Apr 2019 12:18:13 -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=F7TIWgjY; 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 S1727427AbfD3TSM (ORCPT + 30 others); Tue, 30 Apr 2019 15:18:12 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:35656 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbfD3TRi (ORCPT ); Tue, 30 Apr 2019 15:17:38 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHaGS074218; Tue, 30 Apr 2019 14:17:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1556651856; bh=55aFxS37+ts7a5rVXEuf6vFbFoPDWE7uJGT2pp1DmwQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=F7TIWgjYmfyjPMcCTjVuFXdGUTrArANyuZUWI9uTMNjZFctjRE0LtQfWbfZvoYPvi so0LIrqH+/QOES2e7yTeLYLIYgU+J0W5aI9z7oPv7a2cKb5oZwdG4l6IvGMv0aL18c 05hzHBAqRTRmRYKsRipITXNHNX2XZGPy19J/YReU= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3UJHao2088690 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Apr 2019 14:17:36 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) 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.1713.5; Tue, 30 Apr 2019 14:17:35 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 30 Apr 2019 14:17:35 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3UJHZTO063032; Tue, 30 Apr 2019 14:17:35 -0500 From: Dan Murphy To: , CC: , , Dan Murphy , Lee Jones Subject: [PATCH v3 6/7] mfd: ti-lmu: Remove support for LM3697 Date: Tue, 30 Apr 2019 14:17:29 -0500 Message-ID: <20190430191730.19450-7-dmurphy@ti.com> X-Mailer: git-send-email 2.21.0.5.gaeb582a983 In-Reply-To: <20190430191730.19450-1-dmurphy@ti.com> References: <20190430191730.19450-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 LM3697 from the ti-lmu driver in favor of a dedicated LED driver. Acked-for-MFD-by: Lee Jones Signed-off-by: Dan Murphy --- v3 - No changes - https://lore.kernel.org/patchwork/patch/1058760/ v2 - Fixed commit message LF, removed leds/Kconfig from patch. - https://lore.kernel.org/patchwork/patch/1054502/ drivers/mfd/Kconfig | 2 +- drivers/mfd/ti-lmu.c | 17 ----------- include/linux/mfd/ti-lmu-register.h | 44 ----------------------------- include/linux/mfd/ti-lmu.h | 1 - 4 files changed, 1 insertion(+), 63 deletions(-) -- 2.21.0.5.gaeb582a983 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 26ad6468d13a..fcae244229b3 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1312,7 +1312,7 @@ config MFD_TI_LMU help Say yes here to enable support for TI LMU chips. - TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697. + TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, 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 b06cb908d1aa..89b1c5b584af 100644 --- a/drivers/mfd/ti-lmu.c +++ b/drivers/mfd/ti-lmu.c @@ -111,20 +111,6 @@ static const struct mfd_cell lm3695_devices[] = { }, }; -static const struct mfd_cell lm3697_devices[] = { - { - .name = "ti-lmu-backlight", - .id = LM3697, - .of_compatible = "ti,lm3697-backlight", - }, - /* Monitoring driver for open/short circuit detection */ - { - .name = "ti-lmu-fault-monitor", - .id = LM3697, - .of_compatible = "ti,lm3697-fault-monitor", - }, -}; - #define TI_LMU_DATA(chip, max_reg) \ static const struct ti_lmu_data chip##_data = \ { \ @@ -137,7 +123,6 @@ 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); -TI_LMU_DATA(lm3697, LM3697_MAX_REG); static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id) { @@ -206,7 +191,6 @@ static const struct of_device_id ti_lmu_of_match[] = { { .compatible = "ti,lm3632", .data = &lm3632_data }, { .compatible = "ti,lm3633", .data = &lm3633_data }, { .compatible = "ti,lm3695", .data = &lm3695_data }, - { .compatible = "ti,lm3697", .data = &lm3697_data }, { } }; MODULE_DEVICE_TABLE(of, ti_lmu_of_match); @@ -216,7 +200,6 @@ static const struct i2c_device_id ti_lmu_ids[] = { { "lm3632", LM3632 }, { "lm3633", LM3633 }, { "lm3695", LM3695 }, - { "lm3697", LM3697 }, { } }; MODULE_DEVICE_TABLE(i2c, ti_lmu_ids); diff --git a/include/linux/mfd/ti-lmu-register.h b/include/linux/mfd/ti-lmu-register.h index f09510561a55..76998b01764b 100644 --- a/include/linux/mfd/ti-lmu-register.h +++ b/include/linux/mfd/ti-lmu-register.h @@ -189,48 +189,4 @@ #define LM3695_REG_BRT_MSB 0x14 #define LM3695_MAX_REG 0x14 - -/* LM3697 */ -#define LM3697_REG_HVLED_OUTPUT_CFG 0x10 -#define LM3697_HVLED1_CFG_MASK BIT(0) -#define LM3697_HVLED2_CFG_MASK BIT(1) -#define LM3697_HVLED3_CFG_MASK BIT(2) -#define LM3697_HVLED1_CFG_SHIFT 0 -#define LM3697_HVLED2_CFG_SHIFT 1 -#define LM3697_HVLED3_CFG_SHIFT 2 - -#define LM3697_REG_BL0_RAMP 0x11 -#define LM3697_REG_BL1_RAMP 0x12 -#define LM3697_RAMPUP_MASK 0xF0 -#define LM3697_RAMPUP_SHIFT 4 -#define LM3697_RAMPDN_MASK 0x0F -#define LM3697_RAMPDN_SHIFT 0 - -#define LM3697_REG_RAMP_CONF 0x14 -#define LM3697_RAMP_MASK 0x0F -#define LM3697_RAMP_EACH 0x05 - -#define LM3697_REG_PWM_CFG 0x1C -#define LM3697_PWM_A_MASK BIT(0) -#define LM3697_PWM_B_MASK BIT(1) - -#define LM3697_REG_IMAX_A 0x17 -#define LM3697_REG_IMAX_B 0x18 - -#define LM3697_REG_FEEDBACK_ENABLE 0x19 - -#define LM3697_REG_BRT_A_LSB 0x20 -#define LM3697_REG_BRT_A_MSB 0x21 -#define LM3697_REG_BRT_B_LSB 0x22 -#define LM3697_REG_BRT_B_MSB 0x23 - -#define LM3697_REG_ENABLE 0x24 - -#define LM3697_REG_OPEN_FAULT_STATUS 0xB0 - -#define LM3697_REG_SHORT_FAULT_STATUS 0xB2 - -#define LM3697_REG_MONITOR_ENABLE 0xB4 - -#define LM3697_MAX_REG 0xB4 #endif diff --git a/include/linux/mfd/ti-lmu.h b/include/linux/mfd/ti-lmu.h index 7762c1bce55d..54e9d272e81c 100644 --- a/include/linux/mfd/ti-lmu.h +++ b/include/linux/mfd/ti-lmu.h @@ -26,7 +26,6 @@ enum ti_lmu_id { LM3632, LM3633, LM3695, - LM3697, LMU_MAX_ID, };