Received: by 2002:a17:90a:c8b:0:0:0:0 with SMTP id v11csp2294999pja; Fri, 19 Apr 2019 11:27:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqO8Q/CivrnaCXPftc6NEi5oNMmHpuH2gHCUcaaqon8KUKxPQqxpABewSmGnJsU/nv2FQZ X-Received: by 2002:aa7:8c13:: with SMTP id c19mr5312250pfd.225.1555698471991; Fri, 19 Apr 2019 11:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555698471; cv=none; d=google.com; s=arc-20160816; b=Q91uiXDm97ow2YXzVHaEtGvLli+7pM4v9kPSS5XROD3CTbDokadoTVtZQUJObW+wrp onw0LVdrSy/o7qcn2H9DGuBRRT0BQ/QL3VcLYaVWPhFT5kFJG5BmeuSgbKoe+JGDtkGq UrlF8EivPQpNc5nualbHJVBstK22MPS8Fsbxr1ZTr+u+TdHAXCWlkHI3TRe6dT3r6KSA 6rUOoUzt/pO/BOKIKKeYnV3Od9U2qI4XMq685J9qNFG2kgWsdclpJsA9vHRYGivHSI8u GqM7UJT7oeM6rEm9OeTz/OIPGV7Y83ljKbOHuVJ6NR7OzncWOdmtxAVFR5SMq8QcZ1Ge rLpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=DI+Wp2iP1Yej61R/QW21QuoK43+W17C0/uq/KBYfnII=; b=Rgo3RkGaeTZ6TNg/bgTpPb7pQn7f7HxlUaNV9AEr5iOqokOWdjI4dUMqGn77QvlUZ7 reMyQWNwTpJn+kFSgPYxdUAIOYdL+KiRGIpWMhD/Ii+h1XW+6DxYoWPTR+a+drOigNZI 2HfpOz60sDdlQRK+7Cn4cplgUSHShx/ELNZuOeeiN8PCailsrGmIthhwRpx11uULpHbI N7yvhIBgvP69Nb165wK2YrB3rXFV1YSJ6iUyqd9OJcplpao5RUBSQBlz+GutgNe3W16L HUnM7sopydwRVTvt4w4pZhYkLBs58rPBJOlBMx80XFWr44/ooi4MFO5gFo+5Xovn/oWF OuQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=N3NGHA32; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si5624646plr.204.2019.04.19.11.27.37; Fri, 19 Apr 2019 11:27: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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=N3NGHA32; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727708AbfDSSZG (ORCPT + 99 others); Fri, 19 Apr 2019 14:25:06 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:38528 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfDSSUm (ORCPT ); Fri, 19 Apr 2019 14:20:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=DI+Wp2iP1Yej61R/QW21QuoK43+W17C0/uq/KBYfnII=; b=N3NGHA32Yy6s zCsL25ajG2YdkIO3kzBAuYoD9PiZ0Qdsa0OP+vocFz41CMrzPxOWZyoF6z7fhU33tWP67MC8pjlsM H1ZnCb3qekdYynWPVOUtDJ0hBO9UMgQsIUP4fndn01uMdGh7PSE25jlBj18VWFVzT8J70DCvBArp+ 87bR0=; Received: from 188.29.164.213.threembb.co.uk ([188.29.164.213] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hHW9k-00007g-Kg; Fri, 19 Apr 2019 16:14:28 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 640AC441D3C; Fri, 19 Apr 2019 17:14:26 +0100 (BST) From: Mark Brown To: Axel Lin Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Philipp Zabel Subject: Applied "regulator: ltc3589: Get rid of struct ltc3589_regulator" to the regulator tree In-Reply-To: <20190418114500.1098-2-axel.lin@ingics.com> X-Patchwork-Hint: ignore Message-Id: <20190419161426.640AC441D3C@finisterre.ee.mobilebroadband> Date: Fri, 19 Apr 2019 17:14:26 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: ltc3589: Get rid of struct ltc3589_regulator has been applied to the regulator tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.2 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 7d110b65553079f7125a1df611dffab96c2429f0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 18 Apr 2019 19:44:59 +0800 Subject: [PATCH] regulator: ltc3589: Get rid of struct ltc3589_regulator After converting to use simplified DT parsing, the struct ltc3589_regulator only has a desc member. So let's remove struct ltc3589_regulator and use struct regulator_desc instead. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/ltc3589.c | 69 +++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c index 35741f476024..077e73715514 100644 --- a/drivers/regulator/ltc3589.c +++ b/drivers/regulator/ltc3589.c @@ -84,15 +84,11 @@ enum ltc3589_reg { LTC3589_NUM_REGULATORS, }; -struct ltc3589_regulator { - struct regulator_desc desc; -}; - struct ltc3589 { struct regmap *regmap; struct device *dev; enum ltc3589_variant variant; - struct ltc3589_regulator regulator_descs[LTC3589_NUM_REGULATORS]; + struct regulator_desc regulator_descs[LTC3589_NUM_REGULATORS]; struct regulator_dev *regulators[LTC3589_NUM_REGULATORS]; }; @@ -209,7 +205,7 @@ static int ltc3589_of_parse_cb(struct device_node *np, struct regulator_config *config) { struct ltc3589 *ltc3589 = config->driver_data; - struct ltc3589_regulator *rdesc = <c3589->regulator_descs[desc->id]; + struct regulator_desc *rdesc = <c3589->regulator_descs[desc->id]; u32 r[2]; int ret; @@ -227,36 +223,34 @@ static int ltc3589_of_parse_cb(struct device_node *np, if (!r[0] || !r[1]) return 0; - rdesc->desc.min_uV = ltc3589_scale(desc->min_uV, r[0], r[1]); - rdesc->desc.uV_step = ltc3589_scale(desc->uV_step, r[0], r[1]); - rdesc->desc.fixed_uV = ltc3589_scale(desc->fixed_uV, r[0], r[1]); + rdesc->min_uV = ltc3589_scale(desc->min_uV, r[0], r[1]); + rdesc->uV_step = ltc3589_scale(desc->uV_step, r[0], r[1]); + rdesc->fixed_uV = ltc3589_scale(desc->fixed_uV, r[0], r[1]); return 0; } #define LTC3589_REG(_name, _of_name, _ops, en_bit, dtv1_reg, dtv_mask, go_bit)\ [LTC3589_ ## _name] = { \ - .desc = { \ - .name = #_name, \ - .of_match = of_match_ptr(#_of_name), \ - .regulators_node = of_match_ptr("regulators"), \ - .of_parse_cb = ltc3589_of_parse_cb, \ - .n_voltages = (dtv_mask) + 1, \ - .min_uV = (go_bit) ? 362500 : 0, \ - .uV_step = (go_bit) ? 12500 : 0, \ - .ramp_delay = (go_bit) ? 1750 : 0, \ - .fixed_uV = (dtv_mask) ? 0 : 800000, \ - .ops = <c3589_ ## _ops ## _regulator_ops, \ - .type = REGULATOR_VOLTAGE, \ - .id = LTC3589_ ## _name, \ - .owner = THIS_MODULE, \ - .vsel_reg = (dtv1_reg), \ - .vsel_mask = (dtv_mask), \ - .apply_reg = (go_bit) ? LTC3589_VCCR : 0, \ - .apply_bit = (go_bit), \ - .enable_reg = (en_bit) ? LTC3589_OVEN : 0, \ - .enable_mask = (en_bit), \ - }, \ + .name = #_name, \ + .of_match = of_match_ptr(#_of_name), \ + .regulators_node = of_match_ptr("regulators"), \ + .of_parse_cb = ltc3589_of_parse_cb, \ + .n_voltages = (dtv_mask) + 1, \ + .min_uV = (go_bit) ? 362500 : 0, \ + .uV_step = (go_bit) ? 12500 : 0, \ + .ramp_delay = (go_bit) ? 1750 : 0, \ + .fixed_uV = (dtv_mask) ? 0 : 800000, \ + .ops = <c3589_ ## _ops ## _regulator_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = LTC3589_ ## _name, \ + .owner = THIS_MODULE, \ + .vsel_reg = (dtv1_reg), \ + .vsel_mask = (dtv_mask), \ + .apply_reg = (go_bit) ? LTC3589_VCCR : 0, \ + .apply_bit = (go_bit), \ + .enable_reg = (en_bit) ? LTC3589_OVEN : 0, \ + .enable_mask = (en_bit), \ } #define LTC3589_LINEAR_REG(_name, _of_name, _dtv1) \ @@ -267,7 +261,7 @@ static int ltc3589_of_parse_cb(struct device_node *np, #define LTC3589_FIXED_REG(_name, _of_name) \ LTC3589_REG(_name, _of_name, fixed, LTC3589_OVEN_ ## _name, 0, 0, 0) -static struct ltc3589_regulator ltc3589_regulators[LTC3589_NUM_REGULATORS] = { +static const struct regulator_desc ltc3589_regulators[] = { LTC3589_LINEAR_REG(SW1, sw1, B1DTV1), LTC3589_LINEAR_REG(SW2, sw2, B2DTV1), LTC3589_LINEAR_REG(SW3, sw3, B3DTV1), @@ -403,7 +397,7 @@ static int ltc3589_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device *dev = &client->dev; - struct ltc3589_regulator *descs; + struct regulator_desc *descs; struct ltc3589 *ltc3589; int i, ret; @@ -422,11 +416,11 @@ static int ltc3589_probe(struct i2c_client *client, descs = ltc3589->regulator_descs; memcpy(descs, ltc3589_regulators, sizeof(ltc3589_regulators)); if (ltc3589->variant == LTC3589) { - descs[LTC3589_LDO3].desc.fixed_uV = 1800000; - descs[LTC3589_LDO4].desc.volt_table = ltc3589_ldo4; + descs[LTC3589_LDO3].fixed_uV = 1800000; + descs[LTC3589_LDO4].volt_table = ltc3589_ldo4; } else { - descs[LTC3589_LDO3].desc.fixed_uV = 2800000; - descs[LTC3589_LDO4].desc.volt_table = ltc3589_12_ldo4; + descs[LTC3589_LDO3].fixed_uV = 2800000; + descs[LTC3589_LDO4].volt_table = ltc3589_12_ldo4; } ltc3589->regmap = devm_regmap_init_i2c(client, <c3589_regmap_config); @@ -437,8 +431,7 @@ static int ltc3589_probe(struct i2c_client *client, } for (i = 0; i < LTC3589_NUM_REGULATORS; i++) { - struct ltc3589_regulator *rdesc = <c3589->regulator_descs[i]; - struct regulator_desc *desc = &rdesc->desc; + struct regulator_desc *desc = <c3589->regulator_descs[i]; struct regulator_config config = { }; config.dev = dev; -- 2.20.1