diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:07 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:21 -0400 |
commit | 72dcc883d8e5b59105e75ee5265442e458740575 (patch) | |
tree | abe950093416aba615a92c6653f2d32f37a58d45 /drivers/pnp/isapnp | |
parent | 4ab55d8d4f7b910c4c60e0f8ff70d0dfdd484f02 (diff) |
PNP: add debug output to encoders
Add debug output to encoders (enabled by CONFIG_PNP_DEBUG). This
uses dev_printk, so I had to add pnp_dev arguments at the same time.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/isapnp')
-rw-r--r-- | drivers/pnp/isapnp/core.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index b8e639f4f227..6740016437d9 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -980,6 +980,7 @@ static int isapnp_get_resources(struct pnp_dev *dev) | |||
980 | { | 980 | { |
981 | int ret; | 981 | int ret; |
982 | 982 | ||
983 | dev_dbg(&dev->dev, "get resources\n"); | ||
983 | pnp_init_resource_table(&dev->res); | 984 | pnp_init_resource_table(&dev->res); |
984 | isapnp_cfg_begin(dev->card->number, dev->number); | 985 | isapnp_cfg_begin(dev->card->number, dev->number); |
985 | ret = isapnp_read_resources(dev); | 986 | ret = isapnp_read_resources(dev); |
@@ -992,15 +993,19 @@ static int isapnp_set_resources(struct pnp_dev *dev) | |||
992 | struct pnp_resource_table *res = &dev->res; | 993 | struct pnp_resource_table *res = &dev->res; |
993 | int tmp; | 994 | int tmp; |
994 | 995 | ||
996 | dev_dbg(&dev->dev, "set resources\n"); | ||
995 | isapnp_cfg_begin(dev->card->number, dev->number); | 997 | isapnp_cfg_begin(dev->card->number, dev->number); |
996 | dev->active = 1; | 998 | dev->active = 1; |
997 | for (tmp = 0; | 999 | for (tmp = 0; |
998 | tmp < ISAPNP_MAX_PORT | 1000 | tmp < ISAPNP_MAX_PORT |
999 | && (res->port_resource[tmp]. | 1001 | && (res->port_resource[tmp]. |
1000 | flags & (IORESOURCE_IO | IORESOURCE_UNSET)) == IORESOURCE_IO; | 1002 | flags & (IORESOURCE_IO | IORESOURCE_UNSET)) == IORESOURCE_IO; |
1001 | tmp++) | 1003 | tmp++) { |
1004 | dev_dbg(&dev->dev, " set io %d to %#llx\n", | ||
1005 | tmp, (unsigned long long) res->port_resource[tmp].start); | ||
1002 | isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1), | 1006 | isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1), |
1003 | res->port_resource[tmp].start); | 1007 | res->port_resource[tmp].start); |
1008 | } | ||
1004 | for (tmp = 0; | 1009 | for (tmp = 0; |
1005 | tmp < ISAPNP_MAX_IRQ | 1010 | tmp < ISAPNP_MAX_IRQ |
1006 | && (res->irq_resource[tmp]. | 1011 | && (res->irq_resource[tmp]. |
@@ -1009,22 +1014,29 @@ static int isapnp_set_resources(struct pnp_dev *dev) | |||
1009 | int irq = res->irq_resource[tmp].start; | 1014 | int irq = res->irq_resource[tmp].start; |
1010 | if (irq == 2) | 1015 | if (irq == 2) |
1011 | irq = 9; | 1016 | irq = 9; |
1017 | dev_dbg(&dev->dev, " set irq %d to %d\n", tmp, irq); | ||
1012 | isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq); | 1018 | isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq); |
1013 | } | 1019 | } |
1014 | for (tmp = 0; | 1020 | for (tmp = 0; |
1015 | tmp < ISAPNP_MAX_DMA | 1021 | tmp < ISAPNP_MAX_DMA |
1016 | && (res->dma_resource[tmp]. | 1022 | && (res->dma_resource[tmp]. |
1017 | flags & (IORESOURCE_DMA | IORESOURCE_UNSET)) == IORESOURCE_DMA; | 1023 | flags & (IORESOURCE_DMA | IORESOURCE_UNSET)) == IORESOURCE_DMA; |
1018 | tmp++) | 1024 | tmp++) { |
1025 | dev_dbg(&dev->dev, " set dma %d to %lld\n", | ||
1026 | tmp, (unsigned long long) res->dma_resource[tmp].start); | ||
1019 | isapnp_write_byte(ISAPNP_CFG_DMA + tmp, | 1027 | isapnp_write_byte(ISAPNP_CFG_DMA + tmp, |
1020 | res->dma_resource[tmp].start); | 1028 | res->dma_resource[tmp].start); |
1029 | } | ||
1021 | for (tmp = 0; | 1030 | for (tmp = 0; |
1022 | tmp < ISAPNP_MAX_MEM | 1031 | tmp < ISAPNP_MAX_MEM |
1023 | && (res->mem_resource[tmp]. | 1032 | && (res->mem_resource[tmp]. |
1024 | flags & (IORESOURCE_MEM | IORESOURCE_UNSET)) == IORESOURCE_MEM; | 1033 | flags & (IORESOURCE_MEM | IORESOURCE_UNSET)) == IORESOURCE_MEM; |
1025 | tmp++) | 1034 | tmp++) { |
1035 | dev_dbg(&dev->dev, " set mem %d to %#llx\n", | ||
1036 | tmp, (unsigned long long) res->mem_resource[tmp].start); | ||
1026 | isapnp_write_word(ISAPNP_CFG_MEM + (tmp << 3), | 1037 | isapnp_write_word(ISAPNP_CFG_MEM + (tmp << 3), |
1027 | (res->mem_resource[tmp].start >> 8) & 0xffff); | 1038 | (res->mem_resource[tmp].start >> 8) & 0xffff); |
1039 | } | ||
1028 | /* FIXME: We aren't handling 32bit mems properly here */ | 1040 | /* FIXME: We aren't handling 32bit mems properly here */ |
1029 | isapnp_activate(dev->number); | 1041 | isapnp_activate(dev->number); |
1030 | isapnp_cfg_end(); | 1042 | isapnp_cfg_end(); |