All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vijay Khemka <vijaykhemka@fb.com>
To: "ed.tanous@intel.com" <ed.tanous@intel.com>,
	James Feist <james.feist@linux.intel.com>,
	Amithash Prasad <amithash@fb.com>
Cc: Sai Dasari <sdasari@fb.com>, OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: x86-power-control
Date: Thu, 17 Oct 2019 01:13:53 +0000	[thread overview]
Message-ID: <EA590716-271A-4F5C-9B36-80260B7F35B6@fb.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

Hi Ed,
I am trying to use x86-power-control and see there are lots of hard coded values which needs to be configurable as per platform.

  1.  Name of GPIO line, this should be configurable and should also support GPIO number if user doesn’t want to define line name in DTS.
  2.  All delay time as it varies for us per platform like powerPulseTimeMs is 1 sec instead of 200 ms and powerPulseTimeMs is 6 sec instead of 15 sec and these varies for different FB platforms.
  3.  GPIO lines to be monitored, not everyone needs SIO_S5 monitoring or NMI_OUT etc.
  4.  Enable/disable passthrough

Please suggest what is the best way to make these changes. I am ready to work on this to make required change. We can have these config option defined in entity manager or we can accept a new json file for this configuration.

One more question on code, I see following code requires powerButtonMask to be set before aquiring GPIO line. Please let me know who sets this powerButtonMask to true. I know this is related to GPIO passthrough but still couldn’t understand where in code it gets set until someone call set-property of dbus.


power_control::powerButtonIface->register_property(

        "ButtonMasked", false, [](const bool requested, bool& current) {

            if (requested)

            {

                if (power_control::powerButtonMask)

                {

                    return 1;

                }

                if (!power_control::setGPIOOutput(

                        "POWER_OUT", 1, power_control::powerButtonMask))

                {

                    throw std::runtime_error("Failed to request GPIO");

                    return 0;

                }

                std::cerr << "Power Button Masked.\n";

            }

            else

            {

                if (!power_control::powerButtonMask)

                {

                    return 1;

                }

                std::cerr << "Power Button Un-masked\n";

                power_control::powerButtonMask.reset();

            }

Regards
-Vijay

[-- Attachment #2: Type: text/html, Size: 11453 bytes --]

             reply	other threads:[~2019-10-17  1:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17  1:13 Vijay Khemka [this message]
2019-10-17  9:56 ` x86-power-control Michael Richardson
2019-10-17 13:38   ` x86-power-control Oskar Senft
2019-10-17 16:02     ` x86-power-control Bills, Jason M
2019-10-17 17:21       ` x86-power-control Oskar Senft
2019-10-17 19:05         ` x86-power-control Bills, Jason M
2019-10-17 22:13     ` x86-power-control Vijay Khemka
2019-10-17 22:08   ` x86-power-control Vijay Khemka
2019-10-18  6:43     ` x86-power-control Michael Richardson
2019-10-17 16:01 ` x86-power-control Bills, Jason M
2019-10-17 22:32   ` x86-power-control Vijay Khemka
2019-10-17 23:25     ` x86-power-control Bills, Jason M
2019-10-17 23:52       ` x86-power-control Vijay Khemka
2019-10-18 18:00         ` x86-power-control Bills, Jason M
2019-10-18 23:04           ` x86-power-control Vijay Khemka
2019-10-21 23:03             ` x86-power-control Bills, Jason M
2019-10-22  1:15               ` x86-power-control Vijay Khemka
2019-10-22 17:14                 ` x86-power-control Bills, Jason M
2019-10-22 17:46                   ` x86-power-control Vijay Khemka
2019-10-22 17:56                     ` x86-power-control James Feist
2019-10-22 18:04                       ` x86-power-control Johnathan Mantey
2019-10-22 19:06                         ` x86-power-control Johnathan Mantey
2019-10-22 19:12                           ` x86-power-control James Feist
2019-10-23 16:35                         ` x86-power-control Vijay Khemka
2019-11-02  0:33 x86-power-control Vijay Khemka
2019-11-04 19:52 ` x86-power-control Bills, Jason M
2019-11-05  0:33   ` x86-power-control Vijay Khemka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EA590716-271A-4F5C-9B36-80260B7F35B6@fb.com \
    --to=vijaykhemka@fb.com \
    --cc=amithash@fb.com \
    --cc=ed.tanous@intel.com \
    --cc=james.feist@linux.intel.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=sdasari@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.