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

Commit 75422dd9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Remove NFC clock voting for sdm845 platforms"

parents a12154b8 614111bd
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2018, 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
@@ -320,7 +320,6 @@
		qcom,nq-clkreq = <&pm8998_gpios 21 0x00>;
		qcom,nq-esepwr = <&tlmm 116 0x00>;
		interrupt-parent = <&tlmm>;
		qcom,clk-src = "BBCLK3";
		interrupts = <63 0>;
		interrupt-names = "nfc_irq";
		pinctrl-names = "nfc_active", "nfc_suspend";
@@ -328,8 +327,6 @@
			     &nfc_enable_active
			     &nfc_clk_default>;
		pinctrl-1 = <&nfc_int_suspend &nfc_enable_suspend>;
		clocks = <&clock_rpmh RPMH_LN_BB_CLK3>;
		clock-names = "ref_clk";
	};
};

+1 −4
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2018, 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
@@ -319,7 +319,6 @@
		qcom,nq-clkreq = <&pm8998_gpios 21 0x00>;
		qcom,nq-esepwr = <&tlmm 116 0x00>;
		interrupt-parent = <&tlmm>;
		qcom,clk-src = "BBCLK3";
		interrupts = <63 0>;
		interrupt-names = "nfc_irq";
		pinctrl-names = "nfc_active", "nfc_suspend";
@@ -327,8 +326,6 @@
			     &nfc_enable_active
			     &nfc_clk_default>;
		pinctrl-1 = <&nfc_int_suspend &nfc_enable_suspend>;
		clocks = <&clock_rpmh RPMH_LN_BB_CLK3>;
		clock-names = "ref_clk";
	};
};

+1 −4
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, 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
@@ -82,7 +82,6 @@
		qcom,nq-clkreq = <&pm8998_gpios 21 0x00>;
		qcom,nq-esepwr = <&tlmm 116 0x00>;
		interrupt-parent = <&tlmm>;
		qcom,clk-src = "BBCLK3";
		interrupts = <63 0>;
		interrupt-names = "nfc_irq";
		pinctrl-names = "nfc_active", "nfc_suspend";
@@ -90,8 +89,6 @@
			     &nfc_enable_active
			     &nfc_clk_default>;
		pinctrl-1 = <&nfc_int_suspend &nfc_enable_suspend>;
		clocks = <&clock_rpmh RPMH_LN_BB_CLK3>;
		clock-names = "ref_clk";
	};
};

+16 −9
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ struct nqx_platform_data {
	unsigned int firm_gpio;
	unsigned int ese_gpio;
	const char *clk_src_name;
	/* NFC_CLK pin voting state */
	bool clk_pin_voting;
};

static const struct of_device_id msm_match_table[] = {
@@ -487,9 +489,11 @@ int nfc_ioctl_power_states(struct file *filp, unsigned long arg)
			gpio_set_value(nqx_dev->en_gpio, 0);
			usleep_range(10000, 10100);
		}
		if (nqx_dev->pdata->clk_pin_voting) {
			r = nqx_clock_deselect(nqx_dev);
			if (r < 0)
				dev_err(&nqx_dev->client->dev, "unable to disable clock\n");
		}
		nqx_dev->nfc_ven_enabled = false;
	} else if (arg == 1) {
		nqx_enable_irq(nqx_dev);
@@ -502,9 +506,11 @@ int nfc_ioctl_power_states(struct file *filp, unsigned long arg)
		}
		gpio_set_value(nqx_dev->en_gpio, 1);
		usleep_range(10000, 10100);
		if (nqx_dev->pdata->clk_pin_voting) {
			r = nqx_clock_select(nqx_dev);
			if (r < 0)
				dev_err(&nqx_dev->client->dev, "unable to enable clock\n");
		}
		nqx_dev->nfc_ven_enabled = true;
	} else if (arg == 2) {
		/*
@@ -841,12 +847,13 @@ static int nfc_parse_dt(struct device *dev, struct nqx_platform_data *pdata)
		pdata->ese_gpio = -EINVAL;
	}

	r = of_property_read_string(np, "qcom,clk-src", &pdata->clk_src_name);
	if (of_property_read_string(np, "qcom,clk-src", &pdata->clk_src_name))
		pdata->clk_pin_voting = false;
	else
		pdata->clk_pin_voting = true;

	pdata->clkreq_gpio = of_get_named_gpio(np, "qcom,nq-clkreq", 0);

	if (r)
		return -EINVAL;
	return r;
}