mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
drm/xe/i2c: Introduce xe_i2c_irq_present()
In preparation of wider usecases which require checking for I2C IRQ presence, introduce xe_i2c_irq_present() helper. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20251011123509.3233213-2-raag.jadav@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
parent
64d00d41f5
commit
3df5aacb9d
|
|
@ -160,6 +160,11 @@ bool xe_i2c_present(struct xe_device *xe)
|
|||
return xe->i2c && xe->i2c->ep.cookie == XE_I2C_EP_COOKIE_DEVICE;
|
||||
}
|
||||
|
||||
static bool xe_i2c_irq_present(struct xe_device *xe)
|
||||
{
|
||||
return xe->i2c && xe->i2c->adapter_irq;
|
||||
}
|
||||
|
||||
/**
|
||||
* xe_i2c_irq_handler: Handler for I2C interrupts
|
||||
* @xe: xe device instance
|
||||
|
|
@ -170,7 +175,7 @@ bool xe_i2c_present(struct xe_device *xe)
|
|||
*/
|
||||
void xe_i2c_irq_handler(struct xe_device *xe, u32 master_ctl)
|
||||
{
|
||||
if (!xe->i2c || !xe->i2c->adapter_irq)
|
||||
if (!xe_i2c_irq_present(xe))
|
||||
return;
|
||||
|
||||
if (master_ctl & I2C_IRQ)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user