rce823.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package main
  2. import "fmt"
  3. type rce823 struct {
  4. variant string
  5. }
  6. func (r rce823) Scan(ctx Context, addr PCIDevData) {
  7. if addr.Dev == 0 && addr.Func == 0 {
  8. cur := DevTreeNode{
  9. Chip: "drivers/ricoh/rce822",
  10. Comment: "Ricoh cardreader",
  11. Registers: map[string]string{
  12. "sdwppol": fmt.Sprintf("%d", (addr.ConfigDump[0xfb]&2)>>1),
  13. "disable_mask": fmt.Sprintf("0x%x", addr.ConfigDump[0xcb]),
  14. },
  15. PCISlots: []PCISlot{
  16. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 0}, writeEmpty: false},
  17. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 1}, writeEmpty: false},
  18. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 2}, writeEmpty: false},
  19. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 3}, writeEmpty: false},
  20. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 4}, writeEmpty: false},
  21. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 5}, writeEmpty: false},
  22. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 6}, writeEmpty: false},
  23. PCISlot{PCIAddr: PCIAddr{Bus: addr.Bus, Dev: 0x0, Func: 7}, writeEmpty: false},
  24. },
  25. }
  26. PutPCIChip(addr, cur)
  27. }
  28. PutPCIDev(addr, "Ricoh SD card reader")
  29. KconfigBool["DRIVERS_RICOH_RCE822"] = true
  30. }
  31. func init() {
  32. RegisterPCI(0x1180, 0xe822, rce823{})
  33. RegisterPCI(0x1180, 0xe823, rce823{})
  34. }