diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-26 09:29:30 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:15 -0600 |
commit | 72a38e06a20129209eaa0e5211cbf50b192de688 (patch) | |
tree | 4fc0dbb49a2b2810d6ad21bf524637cb5bc732b2 /drivers/misc/cros_ec.c | |
parent | 90b16d1491facd55909bdeca1326766dd5d0b925 (diff) |
dm: cros_ec: Convert cros_ec LPC driver to driver model
This is the last driver to be converted. It requires an LPC bus and a
special check_version() method.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/misc/cros_ec.c')
-rw-r--r-- | drivers/misc/cros_ec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c index 1c29ba83de..efcad89eb0 100644 --- a/drivers/misc/cros_ec.c +++ b/drivers/misc/cros_ec.c @@ -681,11 +681,23 @@ static int cros_ec_check_version(struct cros_ec_dev *dev) struct ec_params_hello req; struct ec_response_hello *resp; +#ifdef CONFIG_DM_CROS_EC + struct dm_cros_ec_ops *ops; + int ret; + + ops = dm_cros_ec_get_ops(dev->dev); + if (ops->check_version) { + ret = ops->check_version(dev->dev); + if (ret) + return ret; + } +#else #ifdef CONFIG_CROS_EC_LPC /* LPC has its own way of doing this */ if (dev->interface == CROS_EC_IF_LPC) return cros_ec_lpc_check_version(dev); #endif +#endif /* * TODO(sjg@chromium.org). |