Commit b69b603bcdeb05f846f76da81e4a681aff6a1001

Authored by Simon Glass
Committed by Bin Meng
1 parent 079b38ba04

x86: pch: Add an ioctl to read power-management info

Add a new ioctl() request to read information about the power-management
system. This can be used to power off the device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Showing 1 changed file with 18 additions and 0 deletions Side-by-side Diff

... ... @@ -16,11 +16,29 @@
16 16 /* Returns HDA config info if Azalia V1CTL enabled, -ENOENT if not */
17 17 PCH_REQ_HDA_CONFIG,
18 18  
  19 + /* Fills out a struct pch_pmbase_info if available */
  20 + PCH_REQ_PMBASE_INFO,
  21 +
19 22 PCH_REQ_TEST1, /* Test requests for sandbox driver */
20 23 PCH_REQ_TEST2,
21 24 PCH_REQ_TEST3,
22 25  
23 26 PCH_REQ_COUNT, /* Number of ioctrls supported */
  27 +};
  28 +
  29 +/**
  30 + * struct pch_pmbase_info - Information filled in by PCH_REQ_PMBASE_INFO
  31 + *
  32 + * @pmbase: IO address of power-management controller
  33 + * @gpio0_en_ofs: Offset of GPIO0 enable register
  34 + * @pm1_sts_ofs: Offset of status register
  35 + * @pm1_cnt_ofs: Offset of control register
  36 + */
  37 +struct pch_pmbase_info {
  38 + u16 base;
  39 + u8 gpio0_en_ofs;
  40 + u8 pm1_sts_ofs;
  41 + u8 pm1_cnt_ofs;
24 42 };
25 43  
26 44 /**