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

Commit c68c6afe authored by Vadivel Thekkamalai's avatar Vadivel Thekkamalai
Browse files

bluetooth: update bluetooth-power platform data



Update bluetooth power driver to support both device tree
to power on bluetooth chipset.

Driver checks for device tree node to provide all the
required vregs and gpio data to power on the bluetooth
chipset.

Change-Id: Ib1bb6f4853bc1ae724817cab53ae3661be034e92
Signed-off-by: default avatarVadivel Thekkamalai <vthekk@codeaurora.org>
parent f9704a3e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ Optional properties:
		Should be specified in pairs (min, max), units uV
  - qca,bt-vdd-ldo-voltage-level: specifies VDD LDO voltage levels for supply.
		Should be specified in pairs (min, max), units uV
  - qca,bt-vdd-xtal-voltage-level: specifies VDD XTAL voltage levels for supply.
                Should be specified in pairs (min, max), units uV

Example:
  bt-ar3002 {
@@ -29,7 +31,9 @@ Example:
    qca,bt-reset-gpio = <&pm8941_gpios 34 0>;
    qca,bt-vdd-io-supply = <&pm8941_s3>;
    qca,bt-vdd-pa-supply = <&pm8941_l19>;
    qca,bt-vdd-xtal-supply = <&pm8994_l30>;
    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>;
  };
+17 −3
Original line number Diff line number Diff line
@@ -197,6 +197,13 @@ static int bluetooth_power(int on)
				goto out;
			}
		}
		if (bt_power_pdata->bt_vdd_xtal) {
			rc = bt_configure_vreg(bt_power_pdata->bt_vdd_xtal);
			if (rc < 0) {
				BT_PWR_ERR("bt_power vddxtal config failed");
				goto vdd_xtal_fail;
			}
		}
		if (bt_power_pdata->bt_vdd_pa) {
			rc = bt_configure_vreg(bt_power_pdata->bt_vdd_pa);
			if (rc < 0) {
@@ -232,13 +239,14 @@ gpio_fail:
			gpio_free(bt_power_pdata->bt_gpio_sys_rst);
		bt_vreg_disable(bt_power_pdata->bt_chip_pwd);
chip_pwd_fail:
		bt_vreg_disable(bt_power_pdata->bt_vdd_pa);
vdd_pa_fail:
		bt_vreg_disable(bt_power_pdata->bt_vdd_ldo);
vdd_ldo_fail:
		bt_vreg_disable(bt_power_pdata->bt_vdd_pa);
vdd_pa_fail:
		bt_vreg_disable(bt_power_pdata->bt_vdd_xtal);
vdd_xtal_fail:
		bt_vreg_disable(bt_power_pdata->bt_vdd_io);
	}

out:
	return rc;
}
@@ -406,6 +414,12 @@ static int bt_power_populate_dt_pinfo(struct platform_device *pdev)
		if (rc < 0)
			return rc;

		rc = bt_dt_parse_vreg_info(&pdev->dev,
					&bt_power_pdata->bt_vdd_xtal,
					"qca,bt-vdd-xtal");
		if (rc < 0)
			return rc;

		rc = bt_dt_parse_vreg_info(&pdev->dev,
					&bt_power_pdata->bt_vdd_pa,
					"qca,bt-vdd-pa");
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, 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
@@ -54,6 +54,8 @@ struct bluetooth_power_platform_data {
	struct bt_power_vreg_data *bt_vdd_pa;
	/* VDD_LDOIN voltage regulator */
	struct bt_power_vreg_data *bt_vdd_ldo;
	/* VDD_XTAL voltage regulator */
	struct bt_power_vreg_data *bt_vdd_xtal;
	/* Optional: chip power down gpio-regulator
	 * chip power down data is required when bluetooth module
	 * and other modules like wifi co-exist in a single chip and