mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
platform/chrome: fix build failure when CONFIG_CIX_EC=m
#ifdef will return false when CONFIG_CIX_EC=m. Switch to IS_ENABLED() to handle this case. Signed-off-by: ZHANG Yuntian <yt@radxa.com> Change-Id: If954959c94e5d1cf16ad7d7bb5543152bbfdad8c
This commit is contained in:
@@ -79,7 +79,7 @@ static bool cros_ec_handle_event(struct cros_ec_device *ec_dev)
|
||||
return ec_has_more_events;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
/**
|
||||
* cix_ec_get_irq_info() - get irq info from EC
|
||||
* @ec_dev: Device which raise the irq
|
||||
@@ -121,7 +121,7 @@ int cix_ec_get_irq_info(struct cros_ec_device *ec_dev)
|
||||
irqreturn_t cros_ec_irq_thread(int irq, void *data)
|
||||
{
|
||||
struct cros_ec_device *ec_dev = data;
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
int rc = cix_ec_get_irq_info(ec_dev);
|
||||
if (rc < 0)
|
||||
return IRQ_NONE;
|
||||
@@ -254,7 +254,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
|
||||
err = devm_request_threaded_irq(dev, ec_dev->irq,
|
||||
cros_ec_irq_handler,
|
||||
cros_ec_irq_thread,
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
|
||||
#else
|
||||
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
|
||||
@@ -328,7 +328,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
/* Maybe EC generates interrupt and EC pulls down gpio before request_irq,
|
||||
* so we must handle the interrupt
|
||||
*/
|
||||
@@ -530,13 +530,13 @@ EXPORT_SYMBOL(cros_ec_resume_early);
|
||||
*/
|
||||
int cros_ec_resume(struct cros_ec_device *ec_dev)
|
||||
{
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
cros_ec_resume_early(ec_dev);
|
||||
cros_ec_resume_complete(ec_dev);
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
ret = cix_ec_get_irq_info(ec_dev);
|
||||
if (ret < 0)
|
||||
dev_err(ec_dev->dev,"Failed: clear interrupts from str wakeup!\n");
|
||||
|
||||
@@ -340,7 +340,7 @@ static int cros_ec_i2c_resume(struct device *dev)
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops cros_ec_i2c_pm_ops = {
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
SYSTEM_SLEEP_PM_OPS(cros_ec_i2c_suspend, cros_ec_i2c_resume)
|
||||
#else
|
||||
SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_i2c_suspend, cros_ec_i2c_resume)
|
||||
|
||||
@@ -884,7 +884,7 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev)
|
||||
dev_warn(ec_dev->dev, "Invalid host event size\n");
|
||||
return 0;
|
||||
}
|
||||
#ifndef CONFIG_CIX_EC
|
||||
#if !IS_ENABLED(CONFIG_CIX_EC)
|
||||
host_event = get_unaligned_le32(&ec_dev->event_data.data.host_event);
|
||||
#endif
|
||||
return host_event;
|
||||
|
||||
@@ -6391,7 +6391,7 @@ struct ec_params_usb_pd_mux_ack {
|
||||
#define EC_LPC_ADDR_OLD_PARAM EC_HOST_CMD_REGION1
|
||||
#define EC_OLD_PARAM_SIZE EC_HOST_CMD_REGION_SIZE
|
||||
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
/*****************************************************************************/
|
||||
/* Cix EC commands */
|
||||
|
||||
@@ -6467,7 +6467,7 @@ struct ec_response_ic_error_info
|
||||
#endif /* CONFIG_CIX_EC_EXCEPTION */
|
||||
#endif /* CONFIG_CIX_EC */
|
||||
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
#define ec_be16_to_cpu(x) be16_to_cpu(x)
|
||||
#define ec_be32_to_cpu(x) be32_to_cpu(x)
|
||||
#define ec_cpu_to_be16(x) cpu_to_be16(x)
|
||||
|
||||
@@ -198,7 +198,7 @@ struct cros_ec_device {
|
||||
struct platform_device *pd;
|
||||
|
||||
struct blocking_notifier_head panic_notifier;
|
||||
#ifdef CONFIG_CIX_EC
|
||||
#if IS_ENABLED(CONFIG_CIX_EC)
|
||||
struct ec_response_int_get_info irq_info;
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user