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

Commit 52a8c7f8 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: Add bluetooth DT for msm8998"

parents b5271be5 2005bcbc
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ Required properties:
  - compatible: Should be set to one of the following:
	qca,ar3002
	qca,qca6174
	qca,wcn3990
  - qca,bt-reset-gpio: GPIO pin to bring BT Controller out of reset

Optional properties:
@@ -18,7 +19,6 @@ Optional properties:
  - qca,bt-chip-pwd-supply: Chip power down gpio is required when bluetooth module
		and other modules like wifi co-exist in a singe chip and shares a
		common gpio to bring chip out of reset.

  - qca,bt-vdd-pa-voltage-level: specifies VDD PA voltage levels for supply.
		Should be specified in pairs (min, max), units uV
  - qca,bt-vdd-io-voltage-level: specifies VDD IO voltage levels for supply.
@@ -29,6 +29,12 @@ Optional properties:
                Should be specified in pairs (min, max), units uV
  - qca,bt-vdd-core-voltage-level: specifies VDD CORE voltage levels for supply.
                Should be specified in pairs (min, max), units uV
 - qca,bt-vdd-io-current-level: specifies VDD IO current level in microamps
 - qca,bt-vdd-xtal-current-level: specifies VDD XTAL current level in microamps
 - qca,bt-vdd-core-current-level: specifies VDD CORE current level in microamps.
 - qca,bt-vdd-ldo-current-level: specifies VDD LDO current level in microamps.
 - qca,bt-vdd-pa-current-level: specifies VDD PA current level in microamps.
 - qca,bt-chip-pwd-current-level: specifies Chip Power current level in microamps.

Example:
  bt-ar3002 {
@@ -39,8 +45,15 @@ Example:
    qca,bt-vdd-xtal-supply = <&pm8994_l30>;
    qca,bt-vdd-core-supply = <&pm8994_s3>;
    qca,bt-chip-pwd-supply = <&ath_chip_pwd_l>;

    qca,bt-vdd-io-voltage-level = <1800000 1800000>;
    qca,bt-vdd-pa-voltage-level = <2900000 2900000>;
    qca,bt-vdd-xtal-voltage-level = <1800000 1800000>;
    qca,bt-vdd-core-voltage-level = <1300000 1300000>;

    qca,bt-vdd-io-current-level = <1>; /* LPM/PFM */
    qca,bt-vdd-xtal-current-level = <1>; /* LPM/PFM */
    qca,bt-vdd-core-current-level = <1>; /* LPM/PFM */
    qca,bt-vdd-ldo-current-level = <1>; /* LPM/PFM */
    qca,bt-vdd-pa-current-level = <1>; /* LPM/PFM */
  };
+24 −0
Original line number Diff line number Diff line
@@ -11,3 +11,27 @@
 */

#include "msmcobalt-pinctrl.dtsi"
/ {
	bluetooth: bt_wcn3990 {
		compatible = "qca,wcn3990";
		qca,bt-vdd-io-supply = <&pmcobalt_s3>;
		qca,bt-vdd-xtal-supply = <&pmcobalt_s5>;
		qca,bt-vdd-core-supply = <&pmcobalt_l7_pin_ctrl>;
		qca,bt-vdd-ldo-supply = <&pmcobalt_l17_pin_ctrl>;
		qca,bt-vdd-pa-supply = <&pmcobalt_l25_pin_ctrl>;
		qca,bt-chip-pwd-supply = <&pmicobalt_bob_pin1>;

		qca,bt-vdd-io-voltage-level = <1350000 1350000>;
		qca,bt-vdd-xtal-voltage-level = <2050000 2050000>;
		qca,bt-vdd-core-voltage-level = <1800000 1800000>;
		qca,bt-vdd-ldo-voltage-level = <1300000 1300000>;
		qca,bt-vdd-pa-voltage-level = <3300000 3300000>;
		qca,bt-chip-pwd-voltage-level = <3600000 3600000>;

		qca,bt-vdd-io-current-level = <1>; /* LPM/PFM */
		qca,bt-vdd-xtal-current-level = <1>; /* LPM/PFM */
		qca,bt-vdd-core-current-level = <1>; /* LPM/PFM */
		qca,bt-vdd-ldo-current-level = <0>; /* LPM/PFM */
		qca,bt-vdd-pa-current-level = <0>; /* LPM/PFM */
	};
};
+24 −0
Original line number Diff line number Diff line
@@ -11,3 +11,27 @@
 */

#include "msmcobalt-pinctrl.dtsi"
/ {
	bluetooth: bt_wcn3990 {
		compatible = "qca,wcn3990";
		qca,bt-vdd-io-supply = <&pmcobalt_s3>;
		qca,bt-vdd-xtal-supply = <&pmcobalt_s5>;
		qca,bt-vdd-core-supply = <&pmcobalt_l7_pin_ctrl>;
		qca,bt-vdd-ldo-supply = <&pmcobalt_l17_pin_ctrl>;
		qca,bt-vdd-pa-supply = <&pmcobalt_l25_pin_ctrl>;
		qca,bt-chip-pwd-supply = <&pmicobalt_bob_pin1>;

		qca,bt-vdd-io-voltage-level = <1350000 1350000>;
		qca,bt-vdd-xtal-voltage-level = <2050000 2050000>;
		qca,bt-vdd-core-voltage-level = <1800000 1800000>;
		qca,bt-vdd-ldo-voltage-level = <1300000 1300000>;
		qca,bt-vdd-pa-voltage-level = <3300000 3300000>;
		qca,bt-chip-pwd-voltage-level = <3600000 3600000>;

		qca,bt-vdd-io-current-level = <1>; /* LPM/PFM */
		qca,bt-vdd-xtal-current-level = <1>; /* LPM/PFM */
		qca,bt-vdd-core-current-level = <0>; /* LPM/PFM */
		qca,bt-vdd-ldo-current-level = <0>; /* LPM/PFM */
		qca,bt-vdd-pa-current-level = <0>; /* LPM/PFM */
	};
};
+36 −9
Original line number Diff line number Diff line
/* Copyright (c) 2009-2010, 2013-2015 The Linux Foundation. All rights reserved.
/* Copyright (c) 2009-2010, 2013-2016 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
@@ -36,6 +36,7 @@
static struct of_device_id bt_power_match_table[] = {
	{	.compatible = "qca,ar3002" },
	{	.compatible = "qca,qca6174" },
	{	.compatible = "qca,wcn3990" },
	{}
};

@@ -85,6 +86,16 @@ static int bt_vreg_enable(struct bt_power_vreg_data *vreg)
			}
		}

		if (vreg->load_uA >= 0) {
			rc = regulator_set_optimum_mode(vreg->reg,
					vreg->load_uA);
			if (rc < 0) {
				BT_PWR_ERR("vreg_set_mode(%s) failed rc=%d\n",
						vreg->name, rc);
				goto out;
			}
		}

		rc = regulator_enable(vreg->reg);
		if (rc < 0) {
			BT_PWR_ERR("regulator_enable(%s) failed. rc=%d\n",
@@ -117,14 +128,19 @@ static int bt_vreg_disable(struct bt_power_vreg_data *vreg)

		if (vreg->set_voltage_sup) {
			/* Set the min voltage to 0 */
			rc = regulator_set_voltage(vreg->reg,
						0,
			rc = regulator_set_voltage(vreg->reg, 0,
					vreg->high_vol_level);
			if (rc < 0) {
				BT_PWR_ERR("vreg_set_vol(%s) failed rc=%d\n",
						vreg->name, rc);
				goto out;

			}
		}
		if (vreg->load_uA >= 0) {
			rc = regulator_set_optimum_mode(vreg->reg, 0);
			if (rc < 0) {
				BT_PWR_ERR("vreg_set_mode(%s) failed rc=%d\n",
						vreg->name, rc);
			}
		}
	}
@@ -154,7 +170,7 @@ static int bt_configure_gpios(int on)
	int rc = 0;
	int bt_reset_gpio = bt_power_pdata->bt_gpio_sys_rst;

	BT_PWR_DBG("%s  bt_gpio= %d on: %d", __func__, bt_reset_gpio, on);
	BT_PWR_DBG("bt_gpio= %d on: %d", bt_reset_gpio, on);

	if (on) {
		rc = gpio_request(bt_reset_gpio, "bt_sys_rst_n");
@@ -211,7 +227,6 @@ static int bluetooth_power(int on)
				goto vdd_core_fail;
			}
		}

		if (bt_power_pdata->bt_vdd_pa) {
			rc = bt_configure_vreg(bt_power_pdata->bt_vdd_pa);
			if (rc < 0) {
@@ -378,6 +393,7 @@ static int bt_dt_parse_vreg_info(struct device *dev,

		vreg->name = vreg_name;

		/* Parse voltage-level from each node */
		snprintf(prop_name, MAX_PROP_SIZE,
				"%s-voltage-level", vreg_name);
		prop = of_get_property(np, prop_name, &len);
@@ -389,10 +405,21 @@ static int bt_dt_parse_vreg_info(struct device *dev,
			vreg->high_vol_level = be32_to_cpup(&prop[1]);
		}

		/* Parse current-level from each node */
		snprintf(prop_name, MAX_PROP_SIZE,
				"%s-current-level", vreg_name);
		ret = of_property_read_u32(np, prop_name, &vreg->load_uA);
		if (ret < 0) {
			BT_PWR_DBG("%s property is not valid\n", prop_name);
			vreg->load_uA = -1;
			ret = 0;
		}

		*vreg_data = vreg;
		BT_PWR_DBG("%s: vol=[%d %d]uV\n",
		BT_PWR_DBG("%s: vol=[%d %d]uV, current=[%d]uA\n",
			vreg->name, vreg->low_vol_level,
			vreg->high_vol_level);
			vreg->high_vol_level,
			vreg->load_uA);
	} else
		BT_PWR_INFO("%s: is not provided in device tree", vreg_name);

+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2016, 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
@@ -27,6 +27,8 @@ struct bt_power_vreg_data {
	/* voltage levels to be set */
	unsigned int low_vol_level;
	unsigned int high_vol_level;
	/* current level to be set */
	unsigned int load_uA;
	/*
	 * is set voltage supported for this regulator?
	 * false => set voltage is not supported