mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
ahci: make ahci_transmit_led_message into a function pointer
Create a new ata_port_operations function pointer called transmit_led_message and give it the default value of ahci_transmit_led_message. This allows AHCI controllers with non-standard LED interfaces to use the existing em_ interface. Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
0a86e1c857
commit
439d7a358f
@ -173,6 +173,7 @@ struct ata_port_operations ahci_ops = {
|
|||||||
.em_store = ahci_led_store,
|
.em_store = ahci_led_store,
|
||||||
.sw_activity_show = ahci_activity_show,
|
.sw_activity_show = ahci_activity_show,
|
||||||
.sw_activity_store = ahci_activity_store,
|
.sw_activity_store = ahci_activity_store,
|
||||||
|
.transmit_led_message = ahci_transmit_led_message,
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
.port_suspend = ahci_port_suspend,
|
.port_suspend = ahci_port_suspend,
|
||||||
.port_resume = ahci_port_resume,
|
.port_resume = ahci_port_resume,
|
||||||
@ -774,7 +775,7 @@ static void ahci_start_port(struct ata_port *ap)
|
|||||||
|
|
||||||
/* EM Transmit bit maybe busy during init */
|
/* EM Transmit bit maybe busy during init */
|
||||||
for (i = 0; i < EM_MAX_RETRY; i++) {
|
for (i = 0; i < EM_MAX_RETRY; i++) {
|
||||||
rc = ahci_transmit_led_message(ap,
|
rc = ap->ops->transmit_led_message(ap,
|
||||||
emp->led_state,
|
emp->led_state,
|
||||||
4);
|
4);
|
||||||
if (rc == -EBUSY)
|
if (rc == -EBUSY)
|
||||||
@ -915,7 +916,7 @@ static void ahci_sw_activity_blink(unsigned long arg)
|
|||||||
led_message |= (1 << 16);
|
led_message |= (1 << 16);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(ap->lock, flags);
|
spin_unlock_irqrestore(ap->lock, flags);
|
||||||
ahci_transmit_led_message(ap, led_message, 4);
|
ap->ops->transmit_led_message(ap, led_message, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ahci_init_sw_activity(struct ata_link *link)
|
static void ahci_init_sw_activity(struct ata_link *link)
|
||||||
@ -1044,7 +1045,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
|
|||||||
if (emp->blink_policy)
|
if (emp->blink_policy)
|
||||||
state &= ~EM_MSG_LED_VALUE_ACTIVITY;
|
state &= ~EM_MSG_LED_VALUE_ACTIVITY;
|
||||||
|
|
||||||
return ahci_transmit_led_message(ap, state, size);
|
return ap->ops->transmit_led_message(ap, state, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
|
static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
|
||||||
@ -1063,7 +1064,7 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
|
|||||||
/* set the LED to OFF */
|
/* set the LED to OFF */
|
||||||
port_led_state &= EM_MSG_LED_VALUE_OFF;
|
port_led_state &= EM_MSG_LED_VALUE_OFF;
|
||||||
port_led_state |= (ap->port_no | (link->pmp << 8));
|
port_led_state |= (ap->port_no | (link->pmp << 8));
|
||||||
ahci_transmit_led_message(ap, port_led_state, 4);
|
ap->ops->transmit_led_message(ap, port_led_state, 4);
|
||||||
} else {
|
} else {
|
||||||
link->flags |= ATA_LFLAG_SW_ACTIVITY;
|
link->flags |= ATA_LFLAG_SW_ACTIVITY;
|
||||||
if (val == BLINK_OFF) {
|
if (val == BLINK_OFF) {
|
||||||
@ -1071,7 +1072,7 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
|
|||||||
port_led_state &= EM_MSG_LED_VALUE_OFF;
|
port_led_state &= EM_MSG_LED_VALUE_OFF;
|
||||||
port_led_state |= (ap->port_no | (link->pmp << 8));
|
port_led_state |= (ap->port_no | (link->pmp << 8));
|
||||||
port_led_state |= EM_MSG_LED_VALUE_ON; /* check this */
|
port_led_state |= EM_MSG_LED_VALUE_ON; /* check this */
|
||||||
ahci_transmit_led_message(ap, port_led_state, 4);
|
ap->ops->transmit_led_message(ap, port_led_state, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emp->blink_policy = val;
|
emp->blink_policy = val;
|
||||||
|
@ -910,6 +910,9 @@ struct ata_port_operations {
|
|||||||
ssize_t (*sw_activity_show)(struct ata_device *dev, char *buf);
|
ssize_t (*sw_activity_show)(struct ata_device *dev, char *buf);
|
||||||
ssize_t (*sw_activity_store)(struct ata_device *dev,
|
ssize_t (*sw_activity_store)(struct ata_device *dev,
|
||||||
enum sw_activity val);
|
enum sw_activity val);
|
||||||
|
ssize_t (*transmit_led_message)(struct ata_port *ap, u32 state,
|
||||||
|
ssize_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Obsolete
|
* Obsolete
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user