Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7039707imu; Thu, 31 Jan 2019 04:03:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN6sY91ELnAg5f7q4H7QpJ1ruk/syf2izMdgpq/tJFOXoiPS+FQ1HhPSHBjezKAHMqmD/GSd X-Received: by 2002:a63:ed03:: with SMTP id d3mr30878421pgi.275.1548936229468; Thu, 31 Jan 2019 04:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548936229; cv=none; d=google.com; s=arc-20160816; b=kH6lfrkN0bhtMztxvn90S6R9O7rJvWkMmPCmin1qWOXXf9nQ4/IDwNuxcGETJrYZfv JZvDp6ZumH3Dg5d8hBcXQSYP/tHLmFRtHlMnuUdk4MAcuzI6/cCKglKITw3/C6hccyTk q4mGAhuDaO70i6Qb5s/+WfdL32lqkqFe4ZKmqq5NGPwxtP81shVqmsM2PCvUr75HVYe+ a0ViRoqikKxUOYwF7jynSPa5CGq7s65Yks9KA1xU/4A7QjKcsLW+ffc3SjgLKlNztkDi TBJLNORLX1B49onM6mRmwJ6fh6PBwO0LX8CJQpY0ONcK72RpijARrTaGyBxyWjlXFULO XPww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FvEO4l3q1daWP1Hr7aRKN2wmuVFYtixXLAF2w7m5GoE=; b=xBkUaJtqTM8FPKR4g95UIiBSm/lQsaqfo1hPUc6s4EiMiRBl9U9D5P616Aq+MTQ59+ zY+CclcvfMoQmJDS4c11F6LN3nCrp792E/SXy9ioswr+Y2XID4BIgru+RWBQi7SiYVOP 9gBFKSg6Ub74WuEL6y2WHK2Z/c7pbJsr7utQtyMbgG2XC5qGewmK2PUSCNfdUWVDlQGS 2roScQkkhHzOD1VqNb225N4D0BQ9tJuVSKz/uWR0MPDQGY95khKgFirToHtAGHNbuiXj 8hPFEQLXhhoViHK7Lts9DO9AI6hSm6pCue4VYdhr3RAn2ZwDMfy5RC/Tta4NScYT6cQ2 AHPQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si4036992pgo.166.2019.01.31.04.03.31; Thu, 31 Jan 2019 04:03:49 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732599AbfAaMDH (ORCPT + 99 others); Thu, 31 Jan 2019 07:03:07 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34558 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732334AbfAaMDF (ORCPT ); Thu, 31 Jan 2019 07:03:05 -0500 Received: by mail-lj1-f194.google.com with SMTP id u89-v6so2477939lje.1; Thu, 31 Jan 2019 04:03:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FvEO4l3q1daWP1Hr7aRKN2wmuVFYtixXLAF2w7m5GoE=; b=poS6EwD++TepBbPjfAzz09UFBZj5wJLeNWeLFlqxjQJp1DnxC3PioHYj53gI37xDTc j51J9rwmZBGDn95T7oi+Sjkv/X13iVe+vftdzW8Q2jLRv+oeLTiYCauIoEpnHJDClv5d u5WFGgudXACVK0ZKdDgfVdRf0MWGHwUNKcUraF/zDcb0Ai7RXMJND0VURjao/Y4sRfUT s2QZkacWKNkbfon3swWqQuqa0RIDvRHgID5doYay7oOBP3WSmG7oMkAYAaY5xrYRK9sz 5i3MipJzXtuP4PUuTJlh41PpjSMYks7WJseXNQeU6pCtbMyF8M3zyYbRmL/STVc52+co 7oKg== X-Gm-Message-State: AJcUukeNMJExq7n50izy7wgosUSQ1ACRMXT93wlYOm2Mvtd0d4E1Gl8F vLROFbZHlWHySIRFFJK6ZAQ= X-Received: by 2002:a2e:87c3:: with SMTP id v3-v6mr27691792ljj.13.1548936182304; Thu, 31 Jan 2019 04:03:02 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id f123sm115751lff.41.2019.01.31.04.03.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 04:03:01 -0800 (PST) Date: Thu, 31 Jan 2019 14:02:49 +0200 From: Matti Vaittinen To: mazziesaccount@gmail.com, matti.vaittinen@fi.rohmeurope.com Cc: heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, sre@kernel.org, lgirdwood@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com, wim@linux-watchdog.org, linux@roeck-us.net, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org Subject: [RFC PATCH v4 02/10] regulator: bd718x7 use chip specific and generic data structs Message-ID: <5c58562b069b8b09ae44b344bb20252ed385993b.1548935790.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Header rohm-bd718x7.h was split to generic and component specific parts. This changed the struct bd718x7. Adapt the regulator driver to these changes. Signed-off-by: Matti Vaittinen Acked-by: Mark Brown --- drivers/regulator/bd718x7-regulator.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c index ccea133778c8..9109920b4a06 100644 --- a/drivers/regulator/bd718x7-regulator.c +++ b/drivers/regulator/bd718x7-regulator.c @@ -1018,11 +1018,11 @@ static int bd718xx_probe(struct platform_device *pdev) struct bd718xx *mfd; struct regulator_config config = { 0 }; struct bd718xx_pmic_inits pmic_regulators[] = { - [BD718XX_TYPE_BD71837] = { + [ROHM_CHIP_TYPE_BD71837] = { .r_datas = bd71837_regulators, .r_amount = ARRAY_SIZE(bd71837_regulators), }, - [BD718XX_TYPE_BD71847] = { + [ROHM_CHIP_TYPE_BD71847] = { .r_datas = bd71847_regulators, .r_amount = ARRAY_SIZE(bd71847_regulators), }, @@ -1037,15 +1037,15 @@ static int bd718xx_probe(struct platform_device *pdev) goto err; } - if (mfd->chip_type >= BD718XX_TYPE_AMOUNT || - !pmic_regulators[mfd->chip_type].r_datas) { + if (mfd->chip.chip_type >= ROHM_CHIP_TYPE_AMOUNT || + !pmic_regulators[mfd->chip.chip_type].r_datas) { dev_err(&pdev->dev, "Unsupported chip type\n"); err = -EINVAL; goto err; } /* Register LOCK release */ - err = regmap_update_bits(mfd->regmap, BD718XX_REG_REGLOCK, + err = regmap_update_bits(mfd->chip.regmap, BD718XX_REG_REGLOCK, (REGLOCK_PWRSEQ | REGLOCK_VREG), 0); if (err) { dev_err(&pdev->dev, "Failed to unlock PMIC (%d)\n", err); @@ -1065,7 +1065,7 @@ static int bd718xx_probe(struct platform_device *pdev) * for all reset types because OTP loading at READY will clear SEL * bit allowing HW defaults for power rails to be used */ - err = regmap_update_bits(mfd->regmap, BD718XX_REG_TRANS_COND1, + err = regmap_update_bits(mfd->chip.regmap, BD718XX_REG_TRANS_COND1, BD718XX_ON_REQ_POWEROFF_MASK | BD718XX_SWRESET_POWEROFF_MASK | BD718XX_WDOG_POWEROFF_MASK | @@ -1078,17 +1078,17 @@ static int bd718xx_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Changed all resets from SVNS to READY\n"); } - for (i = 0; i < pmic_regulators[mfd->chip_type].r_amount; i++) { + for (i = 0; i < pmic_regulators[mfd->chip.chip_type].r_amount; i++) { const struct regulator_desc *desc; struct regulator_dev *rdev; const struct bd718xx_regulator_data *r; - r = &pmic_regulators[mfd->chip_type].r_datas[i]; + r = &pmic_regulators[mfd->chip.chip_type].r_datas[i]; desc = &r->desc; config.dev = pdev->dev.parent; - config.regmap = mfd->regmap; + config.regmap = mfd->chip.regmap; rdev = devm_regulator_register(&pdev->dev, desc, &config); if (IS_ERR(rdev)) { @@ -1104,7 +1104,7 @@ static int bd718xx_probe(struct platform_device *pdev) * can now switch the control from PMIC state machine to the * register interface */ - err = regmap_update_bits(mfd->regmap, r->init.reg, + err = regmap_update_bits(mfd->chip.regmap, r->init.reg, r->init.mask, r->init.val); if (err) { dev_err(&pdev->dev, @@ -1113,7 +1113,7 @@ static int bd718xx_probe(struct platform_device *pdev) goto err; } for (j = 0; j < r->additional_init_amnt; j++) { - err = regmap_update_bits(mfd->regmap, + err = regmap_update_bits(mfd->chip.regmap, r->additional_inits[j].reg, r->additional_inits[j].mask, r->additional_inits[j].val); -- 2.14.3 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then, he vanished ~~~