Commit d8b0a49d authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: deprecate CS_BAD_VCC and CS_BAD_VPP

They were either used to report that changing voltage is not allowed, or that
changing voltage failed.
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent de6405e9
...@@ -82,8 +82,7 @@ static const lookup_t error_table[] = { ...@@ -82,8 +82,7 @@ static const lookup_t error_table[] = {
{ CS_BAD_PAGE, "Bad page number" }, { CS_BAD_PAGE, "Bad page number" },
{ CS_BAD_SIZE, "Bad size" }, { CS_BAD_SIZE, "Bad size" },
{ CS_BAD_TYPE, "Bad type" }, { CS_BAD_TYPE, "Bad type" },
{ CS_BAD_VCC, "Bad Vcc" }, { -EIO, "Input/Output error" },
{ CS_BAD_VPP, "Bad Vpp" },
{ CS_NO_CARD, "No card present" }, { CS_NO_CARD, "No card present" },
{ -EINVAL, "Bad parameter" }, { -EINVAL, "Bad parameter" },
{ CS_GENERAL_FAILURE, "General failure" }, { CS_GENERAL_FAILURE, "General failure" },
......
...@@ -291,20 +291,28 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, ...@@ -291,20 +291,28 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
s->ops->set_socket(s, &s->socket); s->ops->set_socket(s, &s->socket);
} }
if (mod->Attributes & CONF_VCC_CHANGE_VALID) if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
return CS_BAD_VCC; ds_dbg(s, 0, "changing Vcc is not allowed at this time\n");
return -EINVAL;
}
/* We only allow changing Vpp1 and Vpp2 to the same value */ /* We only allow changing Vpp1 and Vpp2 to the same value */
if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) &&
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) { (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
if (mod->Vpp1 != mod->Vpp2) if (mod->Vpp1 != mod->Vpp2)
return CS_BAD_VPP; ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n");
return -EINVAL;
s->socket.Vpp = mod->Vpp1; s->socket.Vpp = mod->Vpp1;
if (s->ops->set_socket(s, &s->socket)) if (s->ops->set_socket(s, &s->socket)) {
return CS_BAD_VPP; dev_printk(KERN_WARNING, &s->dev,
"Unable to set VPP\n");
return -EIO;
}
} else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
return CS_BAD_VPP; ds_dbg(s, 0, "changing Vcc is not allowed at this time\n");
return -EINVAL;
}
if (mod->Attributes & CONF_IO_CHANGE_WIDTH) { if (mod->Attributes & CONF_IO_CHANGE_WIDTH) {
pccard_io_map io_off = { 0, 0, 0, 0, 1 }; pccard_io_map io_off = { 0, 0, 0, 0, 1 };
...@@ -485,8 +493,11 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, ...@@ -485,8 +493,11 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
/* Do power control. We don't allow changes in Vcc. */ /* Do power control. We don't allow changes in Vcc. */
s->socket.Vpp = req->Vpp; s->socket.Vpp = req->Vpp;
if (s->ops->set_socket(s, &s->socket)) if (s->ops->set_socket(s, &s->socket)) {
return CS_BAD_VPP; dev_printk(KERN_WARNING, &s->dev,
"Unable to set socket state\n");
return -EINVAL;
}
/* Pick memory or I/O card, DMA mode, interrupt */ /* Pick memory or I/O card, DMA mode, interrupt */
c->IntType = req->IntType; c->IntType = req->IntType;
......
...@@ -300,8 +300,8 @@ typedef struct error_info_t { ...@@ -300,8 +300,8 @@ typedef struct error_info_t {
#define CS_BAD_SIZE 0x0a #define CS_BAD_SIZE 0x0a
#define CS_BAD_SOCKET -EINVAL #define CS_BAD_SOCKET -EINVAL
#define CS_BAD_TYPE 0x0d #define CS_BAD_TYPE 0x0d
#define CS_BAD_VCC 0x0e #define CS_BAD_VCC -EINVAL
#define CS_BAD_VPP 0x0f #define CS_BAD_VPP -EINVAL
#define CS_BAD_WINDOW -ENODEV #define CS_BAD_WINDOW -ENODEV
#define CS_WRITE_FAILURE -EIO #define CS_WRITE_FAILURE -EIO
#define CS_NO_CARD 0x14 #define CS_NO_CARD 0x14
......
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