Lines Matching refs:kcs_bmc
25 u8 kcs_bmc_read_data(struct kcs_bmc_device *kcs_bmc) in kcs_bmc_read_data() argument
27 return kcs_bmc->ops->io_inputb(kcs_bmc, kcs_bmc->ioreg.idr); in kcs_bmc_read_data()
31 void kcs_bmc_write_data(struct kcs_bmc_device *kcs_bmc, u8 data) in kcs_bmc_write_data() argument
33 kcs_bmc->ops->io_outputb(kcs_bmc, kcs_bmc->ioreg.odr, data); in kcs_bmc_write_data()
37 u8 kcs_bmc_read_status(struct kcs_bmc_device *kcs_bmc) in kcs_bmc_read_status() argument
39 return kcs_bmc->ops->io_inputb(kcs_bmc, kcs_bmc->ioreg.str); in kcs_bmc_read_status()
43 void kcs_bmc_write_status(struct kcs_bmc_device *kcs_bmc, u8 data) in kcs_bmc_write_status() argument
45 kcs_bmc->ops->io_outputb(kcs_bmc, kcs_bmc->ioreg.str, data); in kcs_bmc_write_status()
49 void kcs_bmc_update_status(struct kcs_bmc_device *kcs_bmc, u8 mask, u8 val) in kcs_bmc_update_status() argument
51 kcs_bmc->ops->io_updateb(kcs_bmc, kcs_bmc->ioreg.str, mask, val); in kcs_bmc_update_status()
55 irqreturn_t kcs_bmc_handle_event(struct kcs_bmc_device *kcs_bmc) in kcs_bmc_handle_event() argument
61 spin_lock_irqsave(&kcs_bmc->lock, flags); in kcs_bmc_handle_event()
62 client = kcs_bmc->client; in kcs_bmc_handle_event()
65 spin_unlock_irqrestore(&kcs_bmc->lock, flags); in kcs_bmc_handle_event()
71 int kcs_bmc_enable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client *client) in kcs_bmc_enable_device() argument
75 spin_lock_irq(&kcs_bmc->lock); in kcs_bmc_enable_device()
76 if (kcs_bmc->client) { in kcs_bmc_enable_device()
81 kcs_bmc->client = client; in kcs_bmc_enable_device()
82 kcs_bmc_update_event_mask(kcs_bmc, mask, mask); in kcs_bmc_enable_device()
85 spin_unlock_irq(&kcs_bmc->lock); in kcs_bmc_enable_device()
91 void kcs_bmc_disable_device(struct kcs_bmc_device *kcs_bmc, struct kcs_bmc_client *client) in kcs_bmc_disable_device() argument
93 spin_lock_irq(&kcs_bmc->lock); in kcs_bmc_disable_device()
94 if (client == kcs_bmc->client) { in kcs_bmc_disable_device()
97 kcs_bmc_update_event_mask(kcs_bmc, mask, 0); in kcs_bmc_disable_device()
98 kcs_bmc->client = NULL; in kcs_bmc_disable_device()
100 spin_unlock_irq(&kcs_bmc->lock); in kcs_bmc_disable_device()
104 int kcs_bmc_add_device(struct kcs_bmc_device *kcs_bmc) in kcs_bmc_add_device() argument
110 spin_lock_init(&kcs_bmc->lock); in kcs_bmc_add_device()
111 kcs_bmc->client = NULL; in kcs_bmc_add_device()
114 list_add(&kcs_bmc->entry, &kcs_bmc_devices); in kcs_bmc_add_device()
116 rc = drv->ops->add_device(kcs_bmc); in kcs_bmc_add_device()
120 dev_err(kcs_bmc->dev, "Failed to add chardev for KCS channel %d: %d", in kcs_bmc_add_device()
121 kcs_bmc->channel, rc); in kcs_bmc_add_device()
130 void kcs_bmc_remove_device(struct kcs_bmc_device *kcs_bmc) in kcs_bmc_remove_device() argument
136 list_del(&kcs_bmc->entry); in kcs_bmc_remove_device()
138 rc = drv->ops->remove_device(kcs_bmc); in kcs_bmc_remove_device()
140 dev_err(kcs_bmc->dev, "Failed to remove chardev for KCS channel %d: %d", in kcs_bmc_remove_device()
141 kcs_bmc->channel, rc); in kcs_bmc_remove_device()
149 struct kcs_bmc_device *kcs_bmc; in kcs_bmc_register_driver() local
154 list_for_each_entry(kcs_bmc, &kcs_bmc_devices, entry) { in kcs_bmc_register_driver()
155 rc = drv->ops->add_device(kcs_bmc); in kcs_bmc_register_driver()
157 dev_err(kcs_bmc->dev, "Failed to add driver for KCS channel %d: %d", in kcs_bmc_register_driver()
158 kcs_bmc->channel, rc); in kcs_bmc_register_driver()
166 struct kcs_bmc_device *kcs_bmc; in kcs_bmc_unregister_driver() local
171 list_for_each_entry(kcs_bmc, &kcs_bmc_devices, entry) { in kcs_bmc_unregister_driver()
172 rc = drv->ops->remove_device(kcs_bmc); in kcs_bmc_unregister_driver()
174 dev_err(kcs_bmc->dev, "Failed to remove driver for KCS channel %d: %d", in kcs_bmc_unregister_driver()
175 kcs_bmc->channel, rc); in kcs_bmc_unregister_driver()
181 void kcs_bmc_update_event_mask(struct kcs_bmc_device *kcs_bmc, u8 mask, u8 events) in kcs_bmc_update_event_mask() argument
183 kcs_bmc->ops->irq_mask_update(kcs_bmc, mask, events); in kcs_bmc_update_event_mask()