irqreturn_t kcs_bmc_handle_event(struct kcs_bmc_device *kcs_bmc)
{
struct kcs_bmc_client *client;
- irqreturn_t rc;
+ irqreturn_t rc = IRQ_NONE;
spin_lock(&kcs_bmc->lock);
client = kcs_bmc->client;
- if (client) {
+ if (client)
rc = client->ops->event(client);
- } else {
- u8 status;
-
- status = kcs_bmc_read_status(kcs_bmc);
- if (status & KCS_BMC_STR_IBF) {
- /* Ack the event by reading the data */
- kcs_bmc_read_data(kcs_bmc);
- rc = IRQ_HANDLED;
- } else {
- rc = IRQ_NONE;
- }
- }
spin_unlock(&kcs_bmc->lock);
return rc;
if (kcs_bmc->client) {
rc = -EBUSY;
} else {
+ u8 mask = KCS_BMC_EVENT_TYPE_IBF;
+
kcs_bmc->client = client;
+ kcs_bmc_update_event_mask(kcs_bmc, mask, mask);
rc = 0;
}
spin_unlock_irq(&kcs_bmc->lock);
void kcs_bmc_disable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client *client)
{
spin_lock_irq(&kcs_bmc->lock);
- if (client == kcs_bmc->client)
+ if (client == kcs_bmc->client) {
+ u8 mask = KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE;
+
+ kcs_bmc_update_event_mask(kcs_bmc, mask, 0);
kcs_bmc->client = NULL;
+ }
spin_unlock_irq(&kcs_bmc->lock);
}
EXPORT_SYMBOL(kcs_bmc_disable_device);
platform_set_drvdata(pdev, priv);
- aspeed_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE),
- KCS_BMC_EVENT_TYPE_IBF);
+ aspeed_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE), 0);
aspeed_kcs_enable_channel(kcs_bmc, true);
rc = kcs_bmc_add_device(&priv->kcs_bmc);
if (rc)
return rc;
- npcm7xx_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE),
- KCS_BMC_EVENT_TYPE_IBF);
+ npcm7xx_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE), 0);
npcm7xx_kcs_enable_channel(kcs_bmc, true);
rc = kcs_bmc_add_device(kcs_bmc);