diff mbox

[3/4] acpi: method: add _BTH test

Message ID 1443063679-3270-3-git-send-email-alex.hung@canonical.com
State Accepted
Headers show

Commit Message

Alex Hung Sept. 24, 2015, 3:01 a.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/method/method.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

Comments

Colin Ian King Sept. 28, 2015, 4:15 p.m. UTC | #1
On 24/09/15 04:01, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 6ecc6c9..2487bf4 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -58,7 +58,7 @@
>   * _BMS  10.2.2.5	Y
>   * _BQC  B.6.4		Y
>   * _BST  10.2.2.6	Y
> - * _BTH  10.2.2.7	N
> + * _BTH  10.2.2.7	Y
>   * _BTM  10.2.2.9	Y
>   * _BTP  10.2.2.8	Y
>   * _CBA  PCI f/w spec	Y
> @@ -4980,6 +4980,23 @@ static int method_test_PCL(fwts_framework *fw)
>  		"_PCL", NULL, 0, method_test_PCL_return, "_PCL");
>  }
>  
> +static int method_test_BTH(fwts_framework *fw)
> +{
> +	ACPI_OBJECT arg[1];
> +	int i, ret;
> +	arg[0].Type = ACPI_TYPE_INTEGER;
> +
> +	for (i = 0; i <= 100; i++) {
> +		arg[0].Integer.Value = i;
> +		ret = method_evaluate_method(fw, METHOD_OPTIONAL,
> +			"_BTH", arg, 1, method_test_NULL_return, NULL);
> +
> +		if (ret != FWTS_OK)
> +			break;
> +	}
> +	return ret;
> +}
> +
>  static int method_test_BTM(fwts_framework *fw)
>  {
>  	static int values[] = { 0, 1, 100, 200, 0x7fffffff };
> @@ -6646,6 +6663,7 @@ static fwts_framework_minor_test method_tests[] = {
>  	{ method_test_BMS, "Test _BMS (Battery Measurement Sampling Time)." },
>  	{ method_test_BST, "Test _BST (Battery Status)." },
>  	{ method_test_BTP, "Test _BTP (Battery Trip Point)." },
> +	{ method_test_BTH, "Test _BTH (Battery Throttle Limit)." },
>  	{ method_test_BTM, "Test _BTM (Battery Time)." },
>  	/* { method_test_BLT, "Test _BLT (Battery Level Threshold)." }, */
>  
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu Sept. 30, 2015, 2:49 a.m. UTC | #2
On 2015年09月24日 11:01, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   src/acpi/method/method.c | 20 +++++++++++++++++++-
>   1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 6ecc6c9..2487bf4 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -58,7 +58,7 @@
>    * _BMS  10.2.2.5	Y
>    * _BQC  B.6.4		Y
>    * _BST  10.2.2.6	Y
> - * _BTH  10.2.2.7	N
> + * _BTH  10.2.2.7	Y
>    * _BTM  10.2.2.9	Y
>    * _BTP  10.2.2.8	Y
>    * _CBA  PCI f/w spec	Y
> @@ -4980,6 +4980,23 @@ static int method_test_PCL(fwts_framework *fw)
>   		"_PCL", NULL, 0, method_test_PCL_return, "_PCL");
>   }
>
> +static int method_test_BTH(fwts_framework *fw)
> +{
> +	ACPI_OBJECT arg[1];
> +	int i, ret;
> +	arg[0].Type = ACPI_TYPE_INTEGER;
> +
> +	for (i = 0; i <= 100; i++) {
> +		arg[0].Integer.Value = i;
> +		ret = method_evaluate_method(fw, METHOD_OPTIONAL,
> +			"_BTH", arg, 1, method_test_NULL_return, NULL);
> +
> +		if (ret != FWTS_OK)
> +			break;
> +	}
> +	return ret;
> +}
> +
>   static int method_test_BTM(fwts_framework *fw)
>   {
>   	static int values[] = { 0, 1, 100, 200, 0x7fffffff };
> @@ -6646,6 +6663,7 @@ static fwts_framework_minor_test method_tests[] = {
>   	{ method_test_BMS, "Test _BMS (Battery Measurement Sampling Time)." },
>   	{ method_test_BST, "Test _BST (Battery Status)." },
>   	{ method_test_BTP, "Test _BTP (Battery Trip Point)." },
> +	{ method_test_BTH, "Test _BTH (Battery Throttle Limit)." },
>   	{ method_test_BTM, "Test _BTM (Battery Time)." },
>   	/* { method_test_BLT, "Test _BLT (Battery Level Threshold)." }, */
>
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 6ecc6c9..2487bf4 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -58,7 +58,7 @@ 
  * _BMS  10.2.2.5	Y
  * _BQC  B.6.4		Y
  * _BST  10.2.2.6	Y
- * _BTH  10.2.2.7	N
+ * _BTH  10.2.2.7	Y
  * _BTM  10.2.2.9	Y
  * _BTP  10.2.2.8	Y
  * _CBA  PCI f/w spec	Y
@@ -4980,6 +4980,23 @@  static int method_test_PCL(fwts_framework *fw)
 		"_PCL", NULL, 0, method_test_PCL_return, "_PCL");
 }
 
+static int method_test_BTH(fwts_framework *fw)
+{
+	ACPI_OBJECT arg[1];
+	int i, ret;
+	arg[0].Type = ACPI_TYPE_INTEGER;
+
+	for (i = 0; i <= 100; i++) {
+		arg[0].Integer.Value = i;
+		ret = method_evaluate_method(fw, METHOD_OPTIONAL,
+			"_BTH", arg, 1, method_test_NULL_return, NULL);
+
+		if (ret != FWTS_OK)
+			break;
+	}
+	return ret;
+}
+
 static int method_test_BTM(fwts_framework *fw)
 {
 	static int values[] = { 0, 1, 100, 200, 0x7fffffff };
@@ -6646,6 +6663,7 @@  static fwts_framework_minor_test method_tests[] = {
 	{ method_test_BMS, "Test _BMS (Battery Measurement Sampling Time)." },
 	{ method_test_BST, "Test _BST (Battery Status)." },
 	{ method_test_BTP, "Test _BTP (Battery Trip Point)." },
+	{ method_test_BTH, "Test _BTH (Battery Throttle Limit)." },
 	{ method_test_BTM, "Test _BTM (Battery Time)." },
 	/* { method_test_BLT, "Test _BLT (Battery Level Threshold)." }, */