Received: by 10.213.65.68 with SMTP id h4csp547019imn; Fri, 30 Mar 2018 10:27:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Kn7WIunU0hCTnG1sOyVZ2PlEV3EPlquOlAvOC/eEh+n+DV5gZcEBgt3WSpZS3zBDolyUT X-Received: by 2002:a17:902:8609:: with SMTP id f9-v6mr8999302plo.8.1522430843510; Fri, 30 Mar 2018 10:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522430843; cv=none; d=google.com; s=arc-20160816; b=gpH42NhwvDtapw0TlSreRzRaSPJM6ZhTeKjwanfcXJ/zOE2YzWIM1H4KHw0ISVLCkR Xkb0/WLXFcHG9WBWcwxv6qQJJjt/EfBD2FeEUWM4gB8YiBG6yYca6To79B1GgIyhHybG ikq+30aYPIHbczyDPh2ZBgu7FoQJ6ey10L3fcbcIQPl2jF/12I1GKWilfvjazpPDNoX6 QiyEQeBxjhT/GvGjF5cqzE6pteheqCJwpYmjzHf8NtgK0xmkVfU90g5AMUrZvlqhto/z 8UW7GBnE08Djr/UG0luyml0KSULUoSg5ZEfAtRYjNplS2Xsx43SBRphpbfCdHgfLqnfk BsDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=kXqS0R1KnEwFGBcKycCqf1il2vOZum409xDzFGg/Xr4=; b=HAfg3w2p/p84dwijunczZ70yHNLCs2yNKL0WJWBxSrHNkX4Pcw5kuIiNn1/bgEH9d2 0KngpJYEq7NHyJdzXShJ36OBdpjRYOVp+xPH/2P8n+u/Iusi7Z/WUGk4qH9q00Bvwk/s Ont8UO+gmB7g6wOlMM683hyzLFgFFrobaJw2tlfG9mo+Y8oHWkvno6YTjwWWcPm6Hu6k JkDwcuvIhRidu04TxIvOQX1xMlrHZMq34f3zzenJuTx09mAwkJmLjRGTDGdvtW/fmvfH X2P58vBkng9Z8fWGJ/+3g+whf2yphdVjYzt6qRiFSwp4CPA5N4bOSAflyKHRMZ3fNqIz ljIw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si5766803pgp.268.2018.03.30.10.27.09; Fri, 30 Mar 2018 10:27:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752748AbeC3RZm (ORCPT + 99 others); Fri, 30 Mar 2018 13:25:42 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58964 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbeC3RYj (ORCPT ); Fri, 30 Mar 2018 13:24:39 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id DE0B8260BD3 From: Sebastian Reichel To: Sebastian Reichel , Milo Kim , Lee Jones , Daniel Thompson , Rob Herring , Tony Lindgren Cc: Jingoo Han , Mark Rutland , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, Sebastian Reichel Subject: [PATCHv4 07/10] mfd: ti-lmu: register one backlight device per channel Date: Fri, 30 Mar 2018 19:24:11 +0200 Message-Id: <20180330172414.26575-8-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330172414.26575-1-sebastian.reichel@collabora.co.uk> References: <20180330172414.26575-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All LMU devices support multiple channels, that can be controlled independently. This registers one backlight sub-device per channel. Signed-off-by: Sebastian Reichel --- drivers/mfd/ti-lmu.c | 62 +++++++++++++++++++++++++++++++++++++--------- include/linux/mfd/ti-lmu.h | 4 +++ 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/ti-lmu.c b/drivers/mfd/ti-lmu.c index f43b8acc30e1..f4311d215dfa 100644 --- a/drivers/mfd/ti-lmu.c +++ b/drivers/mfd/ti-lmu.c @@ -56,8 +56,16 @@ static void ti_lmu_disable_hw(void *data) static const struct mfd_cell lm3532_devices[] = { { - .name = "ti-lmu-backlight", - .id = LM3532, + .name = "ti-lmu-led-backlight", + .id = 0, + }, + { + .name = "ti-lmu-led-backlight", + .id = 1, + }, + { + .name = "ti-lmu-led-backlight", + .id = 2, }, }; @@ -75,8 +83,12 @@ static const struct mfd_cell lm3631_devices[] = { LM363X_REGULATOR(LM3631_LDO_POS), LM363X_REGULATOR(LM3631_LDO_NEG), { - .name = "ti-lmu-backlight", - .id = LM3631, + .name = "ti-lmu-led-backlight", + .id = 0, + }, + { + .name = "ti-lmu-led-backlight", + .id = 1, }, }; @@ -85,15 +97,27 @@ static const struct mfd_cell lm3632_devices[] = { LM363X_REGULATOR(LM3632_LDO_POS), LM363X_REGULATOR(LM3632_LDO_NEG), { - .name = "ti-lmu-backlight", - .id = LM3632, + .name = "ti-lmu-led-backlight", + .id = 0, + }, + { + .name = "ti-lmu-led-backlight", + .id = 1, }, }; static const struct mfd_cell lm3633_devices[] = { { - .name = "ti-lmu-backlight", - .id = LM3633, + .name = "ti-lmu-led-backlight", + .id = 0, + }, + { + .name = "ti-lmu-led-backlight", + .id = 1, + }, + { + .name = "ti-lmu-led-backlight", + .id = 2, }, { .name = "lm3633-leds", @@ -109,15 +133,27 @@ static const struct mfd_cell lm3633_devices[] = { static const struct mfd_cell lm3695_devices[] = { { - .name = "ti-lmu-backlight", - .id = LM3695, + .name = "ti-lmu-led-backlight", + .id = 0, + }, + { + .name = "ti-lmu-led-backlight", + .id = 1, }, }; static const struct mfd_cell lm3697_devices[] = { { - .name = "ti-lmu-backlight", - .id = LM3697, + .name = "ti-lmu-led-backlight", + .id = 0, + }, + { + .name = "ti-lmu-led-backlight", + .id = 1, + }, + { + .name = "ti-lmu-led-backlight", + .id = 2, }, /* Monitoring driver for open/short circuit detection */ { @@ -163,6 +199,7 @@ static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id) return -ENOMEM; lmu->dev = &cl->dev; + lmu->id = id->driver_data; /* Setup regmap */ memset(®map_cfg, 0, sizeof(struct regmap_config)); @@ -208,6 +245,7 @@ static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id) * configuration. The notifier enables such kind of handling. */ BLOCKING_INIT_NOTIFIER_HEAD(&lmu->notifier); + lmu->backlight_initialized = false; i2c_set_clientdata(cl, lmu); diff --git a/include/linux/mfd/ti-lmu.h b/include/linux/mfd/ti-lmu.h index 246ab5145dff..708c79adcabe 100644 --- a/include/linux/mfd/ti-lmu.h +++ b/include/linux/mfd/ti-lmu.h @@ -80,6 +80,8 @@ enum lm363x_regulator_id { * @en_gpio: GPIO for HWEN pin [Optional] * @pwm: PWM for module [Optional] * @notifier: Notifier for reporting hwmon event + * @id: Device ID + * @backlight_initialized: Global Backlight has been initialized */ struct ti_lmu { struct device *dev; @@ -87,5 +89,7 @@ struct ti_lmu { struct gpio_desc *en_gpio; struct pwm_device *pwm; struct blocking_notifier_head notifier; + enum ti_lmu_id id; + bool backlight_initialized; }; #endif -- 2.16.2