0015-ec-lenovo-h8-re-factor-handling-of-power_management_.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 5fdab56649a84249c8eecd30caa34318ebde6b1d Mon Sep 17 00:00:00 2001
  2. From: Francis Rowe <info@gluglug.org.uk>
  3. Date: Fri, 12 Jun 2015 23:10:52 +0100
  4. Subject: [PATCH 15/17] ec/lenovo/h8: re-factor handling of
  5. power_management_beeps
  6. The current code duplicates the same check unnecessarily,
  7. and has no handling of when the option power_management_beeps
  8. is not set.
  9. Change-Id: I189c5ce382e1a270d24b9b6e897358268b9a141d
  10. Signed-off-by: Francis Rowe <info@gluglug.org.uk>
  11. ---
  12. src/ec/lenovo/h8/h8.c | 15 ++++++++-------
  13. 1 file changed, 8 insertions(+), 7 deletions(-)
  14. diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
  15. index b6bc406..fde408c 100644
  16. --- a/src/ec/lenovo/h8/h8.c
  17. +++ b/src/ec/lenovo/h8/h8.c
  18. @@ -2,6 +2,7 @@
  19. * This file is part of the coreboot project.
  20. *
  21. * Copyright (C) 2011 Sven Schnelle <svens@stackframe.org>
  22. + * Copyright (C) 2015 Francis Rowe <info@gluglug.org.uk>
  23. *
  24. * This program is free software; you can redistribute it and/or modify
  25. * it under the terms of the GNU General Public License as published by
  26. @@ -212,14 +213,14 @@ static void h8_enable(struct device *dev)
  27. beepmask0 = conf->beepmask0;
  28. beepmask1 = conf->beepmask1;
  29. - if (conf->has_power_management_beeps
  30. - && get_option(&val, "power_management_beeps") == CB_SUCCESS
  31. - && val == 0) {
  32. - beepmask0 = 0x00;
  33. - beepmask1 = 0x00;
  34. - }
  35. -
  36. if (conf->has_power_management_beeps) {
  37. + if (get_option(&val, "power_management_beeps") != CB_SUCCESS)
  38. + val = 1;
  39. + if (!val) {
  40. + beepmask0 = 0x00;
  41. + beepmask1 = 0x00;
  42. + }
  43. +
  44. if (get_option(&val, "low_battery_beep") != CB_SUCCESS)
  45. val = 1;
  46. if (val)
  47. --
  48. 1.9.1