diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-01-21 16:10:40 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <greg@kroah.com> | 2015-01-22 11:27:20 +0800 |
commit | 5357cf323110ee4a3f4a12870618eca28672c7b9 (patch) | |
tree | 720634bcfef7037f5431f06ffdc63dd69f74c20a /drivers/staging/greybus/sdio.c | |
parent | f587027e793cf8947c7cc408a2167db2b8218b15 (diff) |
greybus: Remove "-gb" suffix from .c files
Some files are prefixed with "gb-" and some are suffixed with "-gb". The
rationale behind the first one is that the modules would be named so, i.e.
gb-*.ko. But there is no reason to keep the "-gb" suffix in the second case.
Remove the unnecessary suffix.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/sdio.c')
-rw-r--r-- | drivers/staging/greybus/sdio.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c new file mode 100644 index 000000000000..d324846d09ab --- /dev/null +++ b/drivers/staging/greybus/sdio.c @@ -0,0 +1,99 @@ +/* + * SD/MMC Greybus driver. + * + * Copyright 2014 Google Inc. + * Copyright 2014 Linaro Ltd. + * + * Released under the GPLv2 only. + */ + +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/mmc/host.h> + +#include "greybus.h" + +struct gb_sdio_host { + struct gb_connection *connection; + struct mmc_host *mmc; + struct mmc_request *mrq; + // FIXME - some lock? +}; + +static void gb_sd_request(struct mmc_host *mmc, struct mmc_request *mrq) +{ + // FIXME - do something here... +} + +static void gb_sd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) +{ + // FIXME - do something here... +} + +static int gb_sd_get_ro(struct mmc_host *mmc) +{ + // FIXME - do something here... + return 0; +} + +static const struct mmc_host_ops gb_sd_ops = { + .request = gb_sd_request, + .set_ios = gb_sd_set_ios, + .get_ro = gb_sd_get_ro, +}; + +static int gb_sdio_connection_init(struct gb_connection *connection) +{ + struct mmc_host *mmc; + struct gb_sdio_host *host; + + mmc = mmc_alloc_host(sizeof(*host), &connection->dev); + if (!mmc) + return -ENOMEM; + + host = mmc_priv(mmc); + host->mmc = mmc; + + mmc->ops = &gb_sd_ops; + // FIXME - set up size limits we can handle. + // FIXME - register the host controller. + + host->connection = connection; + connection->private = host; + return 0; +} + +static void gb_sdio_connection_exit(struct gb_connection *connection) +{ + struct mmc_host *mmc; + struct gb_sdio_host *host; + + host = connection->private; + if (!host) + return; + + mmc = host->mmc; + mmc_remove_host(mmc); + mmc_free_host(mmc); + connection->private = NULL; +} + +static struct gb_protocol sdio_protocol = { + .name = "sdio", + .id = GREYBUS_PROTOCOL_SDIO, + .major = 0, + .minor = 1, + .connection_init = gb_sdio_connection_init, + .connection_exit = gb_sdio_connection_exit, + .request_recv = NULL, /* no incoming requests */ +}; + +int gb_sdio_protocol_init(void) +{ + return gb_protocol_register(&sdio_protocol); +} + +void gb_sdio_protocol_exit(void) +{ + gb_protocol_deregister(&sdio_protocol); +} |