Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20de30bb authored by shaohanlin's avatar shaohanlin
Browse files

Merge branch qc2 into vanilla

qc2 ver: LA.UM.7.6.2.r1-06900-89xx.0
parents 79b6422f d92064c3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -308,6 +308,11 @@ First Level Node - QGAUGE device
	Definition: Boolean property to support external-rsense based
		    configuration.

- qcom,qg-vbms-mode
	Usage:      optional
	Value type: <bool>
	Definition: Boolean property to run QG in Voltage-only mode of QG.

- qcom,shutdown-temp-diff
	Usage:      optional
	Value type: <u32>
+53 −0
Original line number Diff line number Diff line
@@ -11,3 +11,56 @@
 */

#include "qm215-qrd.dtsi"

&pm8916_chg{
	qcom,use-external-charger;
};

&pm8916_bms{
	qcom,disable-bms;
};

&tlmm {
		/* SMB interrupt pin */
		smb_int_pin {
			smb_int_default: smb_int_default {
				mux {
					pins = "gpio13";
					function ="gpio";
				};
				config {
					pins = "gpio13";
					bias-pull-up;           /* PULL UP*/
					input-enable;
				};
			};
		};
};

&i2c_2 {
	status ="ok";
	smb1360_otg_supply: smb1360-chg-fg@14 {
		compatible = "qcom,smb1360-chg-fg";
		reg = <0x14>;
		interrupt-parent = <&tlmm>;
		interrupts = <13 8>;
		pinctrl-names = "default";
		pinctrl-0 = <&smb_int_default>;
		qcom,empty-soc-disabled;
		qcom,chg-inhibit-disabled;
		qcom,float-voltage-mv = <4400>;
		qcom,iterm-ma = <100>;
		qcom,recharge-thresh-mv = <100>;
		qcom,thermal-mitigation = <1500 700 600 0>;
		regulator-name = "smb1360_otg_vreg";
		qcom,fg-batt-capacity-mah = <2800>;
		qcom,fg-cutoff-voltage-mv = <3400>;
		qcom,fg-iterm-ma = <130>;
		qcom,fg-delta-soc = <1>;
		status= "okay";
	};
};

&usb_otg {
	extcon = <&smb1360_otg_supply>;
};
+12 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -546,12 +546,22 @@ static void *fast_smmu_alloc(struct device *dev, size_t size,
	av8l_fast_iopte *ptep;
	unsigned long flags;
	struct sg_mapping_iter miter;
	unsigned int count = ALIGN(size, SZ_4K) >> PAGE_SHIFT;
	size_t count = ALIGN(size, SZ_4K) >> PAGE_SHIFT;
	int prot = IOMMU_READ | IOMMU_WRITE; /* TODO: extract from attrs */
	bool is_coherent = is_dma_coherent(dev, attrs);
	pgprot_t remap_prot = __get_dma_pgprot(attrs, PAGE_KERNEL, is_coherent);
	struct page **pages;

	/*
	 * sg_alloc_table_from_pages accepts unsigned int value for count
	 * so check count doesn't exceed UINT_MAX.
	 */

	if (count > UINT_MAX) {
		dev_err(dev, "count: %zx exceeds UNIT_MAX\n", count);
		return NULL;
	}

	prot = __get_iommu_pgprot(attrs, prot, is_coherent);

	*handle = DMA_ERROR_CODE;
+14 −10
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1349,6 +1349,7 @@ static ssize_t iommu_debug_dma_attach_read(struct file *file, char __user *ubuf,
	struct iommu_debug_device *ddev = file->private_data;
	struct device *dev = ddev->dev;
	char c[2];
	size_t buflen = sizeof(c);

	if (*offset)
		return 0;
@@ -1359,13 +1360,14 @@ static ssize_t iommu_debug_dma_attach_read(struct file *file, char __user *ubuf,
		c[0] = dev->archdata.mapping->domain ? '1' : '0';

	c[1] = '\n';
	if (copy_to_user(ubuf, &c, 2)) {
	buflen = min(count, buflen);
	if (copy_to_user(ubuf, &c, buflen)) {
		pr_err("copy_to_user failed\n");
		return -EFAULT;
	}
	*offset = 1;		/* non-zero means we're done */

	return 2;
	return buflen;
}

static const struct file_operations iommu_debug_dma_attach_fops = {
@@ -1393,7 +1395,7 @@ static ssize_t iommu_debug_test_virt_addr_read(struct file *file,
	else
		snprintf(buf, buf_len, "0x%pK\n", test_virt_addr);

	buflen = strlen(buf);
	buflen = min(count, strlen(buf)+1);
	if (copy_to_user(ubuf, buf, buflen)) {
		pr_err("Couldn't copy_to_user\n");
		retval = -EFAULT;
@@ -1424,19 +1426,21 @@ static ssize_t iommu_debug_attach_read(struct file *file, char __user *ubuf,
{
	struct iommu_debug_device *ddev = file->private_data;
	char c[2];
	size_t buflen = sizeof(c);

	if (*offset)
		return 0;

	c[0] = ddev->domain ? '1' : '0';
	c[1] = '\n';
	if (copy_to_user(ubuf, &c, 2)) {
	buflen = min(count, buflen);
	if (copy_to_user(ubuf, &c, buflen)) {
		pr_err("copy_to_user failed\n");
		return -EFAULT;
	}
	*offset = 1;		/* non-zero means we're done */

	return 2;
	return buflen;
}

static const struct file_operations iommu_debug_attach_fops = {
@@ -1514,7 +1518,7 @@ static ssize_t iommu_debug_pte_read(struct file *file, char __user *ubuf,
	else
		snprintf(buf, sizeof(buf), "pte=%016llx\n", pte);

	buflen = strlen(buf);
	buflen = min(count, strlen(buf)+1);
	if (copy_to_user(ubuf, buf, buflen)) {
		pr_err("Couldn't copy_to_user\n");
		retval = -EFAULT;
@@ -1583,7 +1587,7 @@ static ssize_t iommu_debug_atos_read(struct file *file, char __user *ubuf,
		snprintf(buf, 100, "%pa\n", &phys);
	}

	buflen = strlen(buf);
	buflen = min(count, strlen(buf)+1);
	if (copy_to_user(ubuf, buf, buflen)) {
		pr_err("Couldn't copy_to_user\n");
		retval = -EFAULT;
@@ -1636,7 +1640,7 @@ static ssize_t iommu_debug_dma_atos_read(struct file *file, char __user *ubuf,
	else
		snprintf(buf, sizeof(buf), "%pa\n", &phys);

	buflen = strlen(buf);
	buflen = min(count, strlen(buf)+1);
	if (copy_to_user(ubuf, buf, buflen)) {
		pr_err("Couldn't copy_to_user\n");
		retval = -EFAULT;
@@ -1869,7 +1873,7 @@ static ssize_t iommu_debug_dma_map_read(struct file *file, char __user *ubuf,
	iova = ddev->iova;
	snprintf(buf, sizeof(buf), "%pa\n", &iova);

	buflen = strlen(buf);
	buflen = min(count, strlen(buf)+1);
	if (copy_to_user(ubuf, buf, buflen)) {
		pr_err("Couldn't copy_to_user\n");
		retval = -EFAULT;
+9 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2015, 2018-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -314,6 +314,13 @@ static ssize_t qpnp_vib_get_state(struct device *dev,
	return snprintf(buf, PAGE_SIZE, "%d\n", !!chip->reg_en_ctl);
}

static ssize_t qpnp_vib_set_state(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t count)
{
		/* At present, nothing to do with setting state */
		return count;
}

static ssize_t qpnp_vib_get_duration(struct device *dev,
		struct device_attribute *attr, char *buf)
{
@@ -399,7 +406,7 @@ static ssize_t qpnp_vib_set_activate(struct device *dev,
}

static struct device_attribute qpnp_vib_attrs[] = {
	__ATTR(state, 0444, qpnp_vib_get_state, NULL),
	__ATTR(state, 0664, qpnp_vib_get_state, qpnp_vib_set_state),
	__ATTR(duration, 0664, qpnp_vib_get_duration, qpnp_vib_set_duration),
	__ATTR(activate, 0664, qpnp_vib_get_activate, qpnp_vib_set_activate),
};
Loading