On Thu, Jun 25, 2026 at 02:59:38PM +0200, Heikki Krogerus wrote:
> Some devices that are attached to the I2C controller use the
> SMBus Alert signal for example to inform the host about
> thermal events, so registering the default SMBus Alert
> device for them. The alert device makes sure that the alert
> is processed and passed to the correct I2C client driver.

...

> +static int xe_i2c_register_smbus_alert(struct xe_i2c *i2c)
> +{
> +     struct xe_device *xe = kdev_to_xe_device(i2c->drm_dev);
> +     struct i2c_client *alert;
> +
> +     if (xe->info.platform != XE_CRESCENTISLAND)

Rather, introduce a has_i2c_smbus flag in xe_device_types.h and keep
things platform agnostic. I think you'll also need it to early return
from xe_i2c_create_irq().

> +             return 0;
> +
> +     alert = i2c_new_smbus_alert_device(i2c->adapter, &xe_i2c_smbus_setup);
> +     if (IS_ERR(alert))
> +             return PTR_ERR(alert);
> +
> +     i2c->client[XE_I2C_CLIENT_ALERT] = alert;
> +
> +     return 0;
> +}

...

> @@ -182,7 +222,10 @@ void xe_i2c_irq_handler(struct xe_device *xe, u32 
> master_ctl)
>               return;
>  
>       /* Forward interrupt to I2C adapter */
> -     generic_handle_irq_safe(xe->i2c->adapter_irq);
> +     if (xe->info.platform == XE_CRESCENTISLAND)

Ditto.

Raag

> +             xe_i2c_handle_smbus_alert(xe->i2c);
> +     else
> +             generic_handle_irq_safe(xe->i2c->adapter_irq);

Reply via email to