Commit c3f6aa33 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: amplc_dio200.h: remove boardinfo 'mainshift'

This member of the boardinfo is only set for the PCIE boards. Use the
'is_pcie' flag to determine if the offset needs to be shifted when
reading/writing the registers.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c1b0cccc
...@@ -34,7 +34,6 @@ enum dio200_sdtype { sd_none, sd_intr, sd_8255, sd_8254, sd_timer }; ...@@ -34,7 +34,6 @@ enum dio200_sdtype { sd_none, sd_intr, sd_8255, sd_8254, sd_timer };
struct dio200_board { struct dio200_board {
const char *name; const char *name;
unsigned char mainbar; unsigned char mainbar;
unsigned char mainshift;
unsigned short n_subdevs; /* number of subdevices */ unsigned short n_subdevs; /* number of subdevices */
unsigned char sdtype[DIO200_MAX_SUBDEVS]; /* enum dio200_sdtype */ unsigned char sdtype[DIO200_MAX_SUBDEVS]; /* enum dio200_sdtype */
unsigned char sdinfo[DIO200_MAX_SUBDEVS]; /* depends on sdtype */ unsigned char sdinfo[DIO200_MAX_SUBDEVS]; /* depends on sdtype */
......
...@@ -137,7 +137,8 @@ static unsigned char dio200_read8(struct comedi_device *dev, ...@@ -137,7 +137,8 @@ static unsigned char dio200_read8(struct comedi_device *dev,
{ {
const struct dio200_board *board = comedi_board(dev); const struct dio200_board *board = comedi_board(dev);
offset <<= board->mainshift; if (board->is_pcie)
offset <<= 3;
if (dev->mmio) if (dev->mmio)
return readb(dev->mmio + offset); return readb(dev->mmio + offset);
...@@ -149,7 +150,8 @@ static void dio200_write8(struct comedi_device *dev, ...@@ -149,7 +150,8 @@ static void dio200_write8(struct comedi_device *dev,
{ {
const struct dio200_board *board = comedi_board(dev); const struct dio200_board *board = comedi_board(dev);
offset <<= board->mainshift; if (board->is_pcie)
offset <<= 3;
if (dev->mmio) if (dev->mmio)
writeb(val, dev->mmio + offset); writeb(val, dev->mmio + offset);
...@@ -162,7 +164,8 @@ static unsigned int dio200_read32(struct comedi_device *dev, ...@@ -162,7 +164,8 @@ static unsigned int dio200_read32(struct comedi_device *dev,
{ {
const struct dio200_board *board = comedi_board(dev); const struct dio200_board *board = comedi_board(dev);
offset <<= board->mainshift; if (board->is_pcie)
offset <<= 3;
if (dev->mmio) if (dev->mmio)
return readl(dev->mmio + offset); return readl(dev->mmio + offset);
...@@ -174,7 +177,8 @@ static void dio200_write32(struct comedi_device *dev, ...@@ -174,7 +177,8 @@ static void dio200_write32(struct comedi_device *dev,
{ {
const struct dio200_board *board = comedi_board(dev); const struct dio200_board *board = comedi_board(dev);
offset <<= board->mainshift; if (board->is_pcie)
offset <<= 3;
if (dev->mmio) if (dev->mmio)
writel(val, dev->mmio + offset); writel(val, dev->mmio + offset);
......
...@@ -265,7 +265,6 @@ static const struct dio200_board dio200_pci_boards[] = { ...@@ -265,7 +265,6 @@ static const struct dio200_board dio200_pci_boards[] = {
[pcie215_model] = { [pcie215_model] = {
.name = "pcie215", .name = "pcie215",
.mainbar = 1, .mainbar = 1,
.mainshift = 3,
.n_subdevs = 8, .n_subdevs = 8,
.sdtype = { .sdtype = {
sd_8255, sd_none, sd_8255, sd_none, sd_8255, sd_none, sd_8255, sd_none,
...@@ -281,7 +280,6 @@ static const struct dio200_board dio200_pci_boards[] = { ...@@ -281,7 +280,6 @@ static const struct dio200_board dio200_pci_boards[] = {
[pcie236_model] = { [pcie236_model] = {
.name = "pcie236", .name = "pcie236",
.mainbar = 1, .mainbar = 1,
.mainshift = 3,
.n_subdevs = 8, .n_subdevs = 8,
.sdtype = { .sdtype = {
sd_8255, sd_none, sd_none, sd_none, sd_8255, sd_none, sd_none, sd_none,
...@@ -297,7 +295,6 @@ static const struct dio200_board dio200_pci_boards[] = { ...@@ -297,7 +295,6 @@ static const struct dio200_board dio200_pci_boards[] = {
[pcie296_model] = { [pcie296_model] = {
.name = "pcie296", .name = "pcie296",
.mainbar = 1, .mainbar = 1,
.mainshift = 3,
.n_subdevs = 8, .n_subdevs = 8,
.sdtype = { .sdtype = {
sd_8255, sd_8255, sd_8255, sd_8255, sd_8255, sd_8255, sd_8255, sd_8255,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment