From patchwork Wed Jun 5 12:56:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 165879 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7305959ili; Wed, 5 Jun 2019 05:56:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzag7JS1cOgpCoMVtYKg6vjIVZHXECj1VUwjOm0bC8+IrSkzmUexE8OeltWPoV6aBw10rXi X-Received: by 2002:a17:90a:208e:: with SMTP id f14mr6494044pjg.57.1559739411512; Wed, 05 Jun 2019 05:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559739411; cv=none; d=google.com; s=arc-20160816; b=i6IYJ2IOD/UBQsiIJZaFG/kryN8XRFjQ86N38lpI7pFlTxDuWFFaHsSGK/ZvbNgEUx yh3ObxDBUOQBqffjMtBH5y/djVnmRlouGkYizAN1lpLa0mp2yBzka2DdKn1J39UNU/iJ w+im3Oj4tAmE4obeJaeFX8nhfo+xEkucB9owvB7/FL8ut+3j4dWisY/4wKCEgoX74R/6 jP23mlIpFJZjcIMRpfmQYvnQTmonLEgxML7RjGTwXc5Pt966w0hduR6t6gDtA58QCfv4 rgVygrs5rHaJAjiX07q7mDtG8MatVqQBe4/eML84NQXAH4ChK45DVfJKUvyb1psh2LW0 BHfQ== 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=5Qq7+pXiVPEvJrBCyn/c4N9VN91Ob2nkGG5Tt/beLVU=; b=akwD0V7PFHvmgOo/T7q6TnCOuDONtGz87EeMsO2HI478C/bvVm2atLs8MujAUY+Ue4 YhkybDhgkbAoQ+Jt2XqMxsAYWaqHJm15QYL1WiNMF6aC0s/OzIQtkOX+MnQloqLWVqPT QnFyRmKd8dXycq3SuUjN0iO0+0xqtZozukYqrChz4Qs9AvW/5l4Fh5fuA30jK5vWaIQS c0JVvYSLPeSsohpu5TNyfatAcr/w3/eob5qHDydF+mIewEZwuIT4EbrF1Zg6P/Ox+b1f kLhGclx5RVCX/WIXhFVmb9KAYfuTUOeHntaqDu5xRmjZDPmZN6uTj+F0sQfaM/77Oyxl 6aPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WTNGd1NA; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-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 t16si29047226plm.65.2019.06.05.05.56.51; Wed, 05 Jun 2019 05:56:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-leds-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=WTNGd1NA; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-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 S1727916AbfFEM4u (ORCPT + 1 other); Wed, 5 Jun 2019 08:56:50 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:45874 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbfFEM4l (ORCPT ); Wed, 5 Jun 2019 08:56:41 -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 x55CubYa034600; Wed, 5 Jun 2019 07:56:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559739397; bh=5Qq7+pXiVPEvJrBCyn/c4N9VN91Ob2nkGG5Tt/beLVU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=WTNGd1NAcX7FzKtnZIttS54v/TV8AAsmyCu9qkiGsreFxgy5trp96QrTivWBM7lGT sqZTIzgGFTboORm1rdKD4o4OC0L2rLmUW1ns0q9ORq207MxiI0KvQNjJhP21qd5CFs QyeISSeTYvoHdwSXyzpm4nJGq398XeKVkUqFFSus= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x55Cubcr087325 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Jun 2019 07:56:37 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 5 Jun 2019 07:56:36 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) 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; Wed, 5 Jun 2019 07:56:36 -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 x55Cuat9087362; Wed, 5 Jun 2019 07:56:36 -0500 From: Dan Murphy To: , , , CC: , , , Dan Murphy Subject: [PATCH v6 2/5] mfd: ti-lmu: Add LM36274 support to the ti-lmu Date: Wed, 5 Jun 2019 07:56:31 -0500 Message-ID: <20190605125634.7042-3-dmurphy@ti.com> X-Mailer: git-send-email 2.21.0.5.gaeb582a983 In-Reply-To: <20190605125634.7042-1-dmurphy@ti.com> References: <20190605125634.7042-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Add the LM36274 register support to the ti-lmu MFD driver. Signed-off-by: Dan Murphy Acked-by: Lee Jones Signed-off-by: Jacek Anaszewski --- drivers/mfd/Kconfig | 5 ++--- drivers/mfd/ti-lmu.c | 14 ++++++++++++++ include/linux/mfd/ti-lmu-register.h | 23 +++++++++++++++++++++++ include/linux/mfd/ti-lmu.h | 4 ++++ 4 files changed, 43 insertions(+), 3 deletions(-) -- 2.21.0.5.gaeb582a983 Acked-by: Pavel Machek diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 8933485b28e7..a69aca3c2dab 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1335,9 +1335,8 @@ config MFD_TI_LMU select REGMAP_I2C help Say yes here to enable support for TI LMU chips. - - TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, and LM3695. - It consists of backlight, LED and regulator driver. + TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, LM3695 and + LM36274. It consists of backlight, LED and regulator driver. It provides consistent device controls for lighting functions. config MFD_OMAP_USB_HOST diff --git a/drivers/mfd/ti-lmu.c b/drivers/mfd/ti-lmu.c index 89b1c5b584af..691ab9dd6236 100644 --- a/drivers/mfd/ti-lmu.c +++ b/drivers/mfd/ti-lmu.c @@ -111,6 +111,17 @@ static const struct mfd_cell lm3695_devices[] = { }, }; +static const struct mfd_cell lm36274_devices[] = { + LM363X_REGULATOR(LM36274_BOOST), + LM363X_REGULATOR(LM36274_LDO_POS), + LM363X_REGULATOR(LM36274_LDO_NEG), + { + .name = "lm36274-leds", + .id = LM36274, + .of_compatible = "ti,lm36274-backlight", + }, +}; + #define TI_LMU_DATA(chip, max_reg) \ static const struct ti_lmu_data chip##_data = \ { \ @@ -123,6 +134,7 @@ 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(lm36274, LM36274_MAX_REG); static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id) { @@ -191,6 +203,7 @@ 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,lm36274", .data = &lm36274_data }, { } }; MODULE_DEVICE_TABLE(of, ti_lmu_of_match); @@ -200,6 +213,7 @@ static const struct i2c_device_id ti_lmu_ids[] = { { "lm3632", LM3632 }, { "lm3633", LM3633 }, { "lm3695", LM3695 }, + { "lm36274", LM36274 }, { } }; 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 76998b01764b..076d8dea38fd 100644 --- a/include/linux/mfd/ti-lmu-register.h +++ b/include/linux/mfd/ti-lmu-register.h @@ -189,4 +189,27 @@ #define LM3695_REG_BRT_MSB 0x14 #define LM3695_MAX_REG 0x14 + +/* LM36274 */ +#define LM36274_REG_REV 0x01 +#define LM36274_REG_BL_CFG_1 0x02 +#define LM36274_REG_BL_CFG_2 0x03 +#define LM36274_REG_BRT_LSB 0x04 +#define LM36274_REG_BRT_MSB 0x05 +#define LM36274_REG_BL_EN 0x08 + +#define LM36274_REG_BIAS_CONFIG_1 0x09 +#define LM36274_EXT_EN_MASK BIT(0) +#define LM36274_EN_VNEG_MASK BIT(1) +#define LM36274_EN_VPOS_MASK BIT(2) + +#define LM36274_REG_BIAS_CONFIG_2 0x0a +#define LM36274_REG_BIAS_CONFIG_3 0x0b +#define LM36274_REG_VOUT_BOOST 0x0c +#define LM36274_REG_VOUT_POS 0x0d +#define LM36274_REG_VOUT_NEG 0x0e +#define LM36274_VOUT_MASK 0x3F + +#define LM36274_MAX_REG 0x13 + #endif diff --git a/include/linux/mfd/ti-lmu.h b/include/linux/mfd/ti-lmu.h index 54e9d272e81c..0957598c7d41 100644 --- a/include/linux/mfd/ti-lmu.h +++ b/include/linux/mfd/ti-lmu.h @@ -26,6 +26,7 @@ enum ti_lmu_id { LM3632, LM3633, LM3695, + LM36274, LMU_MAX_ID, }; @@ -67,6 +68,9 @@ enum lm363x_regulator_id { LM3632_BOOST, /* Boost output */ LM3632_LDO_POS, /* Positive display bias output */ LM3632_LDO_NEG, /* Negative display bias output */ + LM36274_BOOST, /* Boost output */ + LM36274_LDO_POS, /* Positive display bias output */ + LM36274_LDO_NEG, /* Negative display bias output */ }; /**