Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp34786ybl; Thu, 15 Aug 2019 12:09:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXCSi+btJuBYqXZZQgXxp4wtMjNkaKFRk9lN3og5Fw9tNBDQHknJ9TS/evgpauyA/ZmEAX X-Received: by 2002:a62:8343:: with SMTP id h64mr6677814pfe.170.1565896162855; Thu, 15 Aug 2019 12:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565896162; cv=none; d=google.com; s=arc-20160816; b=K4sH/lm777YPW8sJl63m+PQ4j6atpjXP8GMe/97C2BkQHjo61wKpm/+5C0txQDAhRd GyNhbdYIJwZ/PJPWhU/2N2vmWeVrxYTZr9FUigxNU8EghAWDByWQLiVF0+Ueksm5xcPE HwtlpJ7L4zKn2qHg+hCiHGYr1Epbl0Qmx+IHa7NXOtZfaG/o3iQLWWJ74wGDmF3X43xs sXqNjx+ovUv4TYLfpZBP7yYihGD4X5drb6Sy6t6F+hKi7IQ5yyqv4jv7vB/AIgothyX3 Q/Jcear420H0ruimPDV7jFKJxtej3lH4JXXKnByOAz6p85LzI+R8y1Pxuj3h0MR5NgZ2 BgTA== 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; bh=STOMTB8soQ9SpdsHI1kcwCTKID5AQX15fSXLD/Rbf0M=; b=VZac2O68U/RLUkdFCPNme0cDJ3f+JzuplJ9YKxynuJ2qU6jQTdTwdnXLBtaH/7qXDL BsWtUfQp/G0482YGoJmnycwbLEUbUjnRI6+iQKjpF/IzioCk20jPm3C2JPEIJ6sYoySo yyqHCJrI8H2RASWJYvT6Hrq6ja0fRdCf6zsxR8p1mX0EX9Y9tOE8mqfof1L0z9Sd/SNK D8trquF3ARW6HHU953/W0w/IR6Ht/6qR3Vl/K8hIq17SJde2eydfilZKESQSHpucjPh7 2zOqijuaDN9reo1asjvaVaUoVoN2Dg3vciII+jtPujbKNU2gpif9yN8NoZ1gRfUCZ4Gz qS9Q== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z190si2277935pgd.303.2019.08.15.12.09.06; Thu, 15 Aug 2019 12:09:22 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731896AbfHOROo (ORCPT + 99 others); Thu, 15 Aug 2019 13:14:44 -0400 Received: from mail-ed1-f99.google.com ([209.85.208.99]:38371 "EHLO mail-ed1-f99.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731827AbfHOROi (ORCPT ); Thu, 15 Aug 2019 13:14:38 -0400 Received: by mail-ed1-f99.google.com with SMTP id r12so2720786edo.5 for ; Thu, 15 Aug 2019 10:14:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:message-id:date; bh=STOMTB8soQ9SpdsHI1kcwCTKID5AQX15fSXLD/Rbf0M=; b=KQXFVqadKbd1VdjiK57cz927LmQtxURTQpOaEGLNxjgItx7zMHta+bfTWi6Khup+LX cPUflXNUhiMKTsRrC0VcqYaHla9xAeGNrIbwhZWfRyOok469IeXsL+7VOj3ckmhwokUI 0ik2iDy39ZMBFGg64q5jRTObzLhBo1DeTiWlrn69Hr3XIUBUp53oNaIXh3N8F9NXe/bx jr4J2CbW6wCl0GFYgZtPb7EV1hQs0QHAAdDSeD/GOFCEW1ZOuxH5fWzzO1te3ILJLhRy dL/MiCHRCf57MfiPUJOXfiGfE+DrE6jGCimLCPdpJ90daRnXR7yVP3GXbLI5refOATPC crXg== X-Gm-Message-State: APjAAAU8CySGQSv8r0GJ5V/JYOBJwDmK3oqg+amo7b/vDoNvAZS6ARZL mhznZmPTJ7NCFZqq3HgqNnvFp87U+qhHI2FqiO3poDNdLQSzL93Z/NkS16rV9caRfQ== X-Received: by 2002:a50:ba81:: with SMTP id x1mr6456670ede.257.1565889276186; Thu, 15 Aug 2019 10:14:36 -0700 (PDT) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk. [2a01:7e01::f03c:91ff:fed4:a3b6]) by smtp-relay.gmail.com with ESMTPS id m17sm21059ejc.94.2019.08.15.10.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2019 10:14:36 -0700 (PDT) X-Relaying-Domain: sirena.org.uk Received: from ypsilon.sirena.org.uk ([2001:470:1f1d:6b5::7]) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hyJKd-000531-Qb; Thu, 15 Aug 2019 17:14:35 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 3A8AC2742BC7; Thu, 15 Aug 2019 18:14:35 +0100 (BST) From: Mark Brown To: Andreas Kemnade Cc: Adam Ford , broonie@kernel.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-pm@vger.kernel.org, Mark Brown , nm@ti.com, sboyd@kernel.org, stable@vger.kernel.org, tony@atomide.com, vireshk@kernel.org Subject: Applied "regulator: twl: voltage lists for vdd1/2 on twl4030" to the regulator tree In-Reply-To: <20190814214319.24087-1-andreas@kemnade.info> X-Patchwork-Hint: ignore Message-Id: <20190815171435.3A8AC2742BC7@ypsilon.sirena.org.uk> Date: Thu, 15 Aug 2019 18:14:35 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: twl: voltage lists for vdd1/2 on twl4030 has been applied to the regulator tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.3 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 3829100a63724f6dbf264b2a7f06e7f638ed952d Mon Sep 17 00:00:00 2001 From: Andreas Kemnade Date: Wed, 14 Aug 2019 23:43:19 +0200 Subject: [PATCH] regulator: twl: voltage lists for vdd1/2 on twl4030 _opp_supported_by_regulators() wrongly ignored errors from regulator_is_supported_voltage(), so it considered errors as success. Since commit 498209445124 ("regulator: core: simplify return value on suported_voltage") regulator_is_supported_voltage() returns a real boolean, so errors make _opp_supported_by_regulators() return false. That reveals a problem with the declaration of the VDD1/2 regulators on twl4030. The VDD1/VDD2 regulators on twl4030 are neither defined with voltage lists nor with the continuous flag set, so regulator_is_supported_voltage() returns false and an error before above mentioned commit (which was considered success) The result is that after the above mentioned commit cpufreq does not work properly e.g. dm3730. [ 2.490997] core: _opp_supported_by_regulators: OPP minuV: 1012500 maxuV: 1012500, not supported by regulator [ 2.501617] cpu cpu0: _opp_add: OPP not supported by regulators (300000000) [ 2.509246] core: _opp_supported_by_regulators: OPP minuV: 1200000 maxuV: 1200000, not supported by regulator [ 2.519775] cpu cpu0: _opp_add: OPP not supported by regulators (600000000) [ 2.527313] core: _opp_supported_by_regulators: OPP minuV: 1325000 maxuV: 1325000, not supported by regulator [ 2.537750] cpu cpu0: _opp_add: OPP not supported by regulators (800000000) The patch fixes declaration of VDD1/2 regulators by adding proper voltage lists. Fixes: 498209445124 ("regulator: core: simplify return value on suported_voltage") Cc: stable@vger.kernel.org Signed-off-by: Andreas Kemnade Tested-by: Adam Ford #logicpd-torpedo-37xx-devkit Link: https://lore.kernel.org/r/20190814214319.24087-1-andreas@kemnade.info Signed-off-by: Mark Brown --- drivers/regulator/twl-regulator.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 6fa15b2d6fb3..866b4dd01da9 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c @@ -359,6 +359,17 @@ static const u16 VINTANA2_VSEL_table[] = { 2500, 2750, }; +/* 600mV to 1450mV in 12.5 mV steps */ +static const struct regulator_linear_range VDD1_ranges[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 68, 12500) +}; + +/* 600mV to 1450mV in 12.5 mV steps, everything above = 1500mV */ +static const struct regulator_linear_range VDD2_ranges[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 68, 12500), + REGULATOR_LINEAR_RANGE(1500000, 69, 69, 12500) +}; + static int twl4030ldo_list_voltage(struct regulator_dev *rdev, unsigned index) { struct twlreg_info *info = rdev_get_drvdata(rdev); @@ -427,6 +438,8 @@ static int twl4030smps_get_voltage(struct regulator_dev *rdev) } static const struct regulator_ops twl4030smps_ops = { + .list_voltage = regulator_list_voltage_linear_range, + .set_voltage = twl4030smps_set_voltage, .get_voltage = twl4030smps_get_voltage, }; @@ -466,7 +479,8 @@ static const struct twlreg_info TWL4030_INFO_##label = { \ }, \ } -#define TWL4030_ADJUSTABLE_SMPS(label, offset, num, turnon_delay, remap_conf) \ +#define TWL4030_ADJUSTABLE_SMPS(label, offset, num, turnon_delay, remap_conf, \ + n_volt) \ static const struct twlreg_info TWL4030_INFO_##label = { \ .base = offset, \ .id = num, \ @@ -479,6 +493,9 @@ static const struct twlreg_info TWL4030_INFO_##label = { \ .owner = THIS_MODULE, \ .enable_time = turnon_delay, \ .of_map_mode = twl4030reg_map_mode, \ + .n_voltages = n_volt, \ + .n_linear_ranges = ARRAY_SIZE(label ## _ranges), \ + .linear_ranges = label ## _ranges, \ }, \ } @@ -518,8 +535,8 @@ TWL4030_ADJUSTABLE_LDO(VSIM, 0x37, 9, 100, 0x00); TWL4030_ADJUSTABLE_LDO(VDAC, 0x3b, 10, 100, 0x08); TWL4030_ADJUSTABLE_LDO(VINTANA2, 0x43, 12, 100, 0x08); TWL4030_ADJUSTABLE_LDO(VIO, 0x4b, 14, 1000, 0x08); -TWL4030_ADJUSTABLE_SMPS(VDD1, 0x55, 15, 1000, 0x08); -TWL4030_ADJUSTABLE_SMPS(VDD2, 0x63, 16, 1000, 0x08); +TWL4030_ADJUSTABLE_SMPS(VDD1, 0x55, 15, 1000, 0x08, 68); +TWL4030_ADJUSTABLE_SMPS(VDD2, 0x63, 16, 1000, 0x08, 69); /* VUSBCP is managed *only* by the USB subchip */ TWL4030_FIXED_LDO(VINTANA1, 0x3f, 1500, 11, 100, 0x08); TWL4030_FIXED_LDO(VINTDIG, 0x47, 1500, 13, 100, 0x08); -- 2.20.1