lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1384263715-5713-1-git-send-email-k.kozlowski@samsung.com>
Date:	Tue, 12 Nov 2013 14:41:55 +0100
From:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
To:	Sangbeom Kim <sbkim73@...sung.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org
Cc:	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: [PATCH] regulator: s5m8767: Disable OVCB in probe

According to SW Guide the Over-Voltage Clamp may malfunction at VBatt
5.25V and 110'C temperature. This may result in overshooting or
undershooting LDO's voltage outputs.
Disable the Over-Voltage Clamp in probe by updating proper bit in all
LDO registers.

The patch uses sec_bulk_read/write() API with reordered buf and count
parameters so it depends on:
  "mfd: sec: reorder params in API for regmap consistency"
  http://www.spinics.net/lists/kernel/msg1632519.html

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
---
 drivers/regulator/s5m8767.c         |   26 ++++++++++++++++++++++++++
 include/linux/mfd/samsung/s5m8767.h |    1 +
 2 files changed, 27 insertions(+)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index ac10db4..7c6fb97 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -478,6 +478,26 @@ static struct regulator_desc regulators[] = {
 	s5m8767_regulator_desc(BUCK9),
 };
 
+/*
+ * Disables Over-Voltage Clamp for all LDO-s.
+ */
+static int s5m8767_reg_disable_ldo_ovcb(struct s5m8767_info *s5m8767)
+{
+	u8 data[28];
+	int i, ret;
+
+	ret = sec_bulk_read(s5m8767->iodev, S5M8767_REG_LDO1, data,
+			ARRAY_SIZE(data));
+	if (ret)
+		return ret;
+
+	for (i = 0; i < ARRAY_SIZE(data); i++)
+		data[i] |= (1 << S5M8767_REG_LDO_SHIFT);
+
+	return sec_bulk_write(s5m8767->iodev, S5M8767_REG_LDO1, data,
+			ARRAY_SIZE(data));
+}
+
 #ifdef CONFIG_OF
 static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev,
 			struct sec_platform_data *pdata,
@@ -886,6 +906,12 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
 		}
 	}
 
+	/*
+	 * Disable Over-Voltage Clamp,
+	 * possible malfunction at VBatt 5.25V and 110'C temperature
+	 */
+	s5m8767_reg_disable_ldo_ovcb(s5m8767);
+
 	for (i = 0; i < pdata->num_regulators; i++) {
 		const struct sec_voltage_desc *desc;
 		int id = pdata->regulators[i].id;
diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h
index 306a95f..d6c09a0 100644
--- a/include/linux/mfd/samsung/s5m8767.h
+++ b/include/linux/mfd/samsung/s5m8767.h
@@ -184,5 +184,6 @@ enum s5m8767_regulators {
 };
 
 #define S5M8767_ENCTRL_SHIFT  6
+#define S5M8767_REG_LDO_SHIFT	7
 
 #endif /* __LINUX_MFD_S5M8767_H */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ