autoport: Improve keyboard detection.

Previously I tried to see if Linux think that port 0x60 is in use by keyboard.
Unfortunately it always thinks that it is. Instead just base off real input
busses used.

Change-Id: I4bb744938f623d29f38396165a1694fee78c3d32
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10376
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <edward.ocallaghan@koparo.com>
This commit is contained in:
Vladimir Serbinenko
2015-05-29 23:53:37 +02:00
parent 239d53e9dc
commit 91195c6437
4 changed files with 37 additions and 1 deletions

View File

@@ -103,4 +103,23 @@ func MakeLogs(outDir string) {
defer out.Close()
io.Copy(out, in)
}
out, err := os.Create(outDir + "/input_bustypes.log")
if err != nil {
log.Fatal(err)
}
defer out.Close()
ClassInputDir := "/sys/class/input/"
files, _ = ioutil.ReadDir(ClassInputDir)
for _, f := range files {
if strings.HasPrefix(f.Name(), "input") && !f.Mode().IsRegular() { /* Allow both dirs and symlinks. */
in, err := os.Open(ClassInputDir + f.Name() + "/id/bustype")
defer in.Close()
if err != nil {
log.Fatal(err)
}
io.Copy(out, in)
}
}
}