greybus: gpbridge.h: move protocol init/exit prototypes

Create gpbridge.h for the gpbridge-specific function prototypes, the
rest of the greybus drivers don't care about them.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
This commit is contained in:
Greg Kroah-Hartman 2016-02-28 14:42:54 -08:00
parent 3522a09fa7
commit c7b0726504
10 changed files with 42 additions and 27 deletions

View File

@ -17,7 +17,7 @@
#include <linux/device.h>
#include "greybus.h"
#include "gpbridge.h"
static int __init gpbridge_init(void)
{

View File

@ -0,0 +1,34 @@
/*
* Greybus GPBridge phy driver
*
* Copyright 2016 Google Inc.
*
* Released under the GPLv2 only.
*/
#ifndef __GPBRIDGE_H
#define __GPBRIDGE_H
extern int gb_gpio_protocol_init(void);
extern void gb_gpio_protocol_exit(void);
extern int gb_pwm_protocol_init(void);
extern void gb_pwm_protocol_exit(void);
extern int gb_uart_protocol_init(void);
extern void gb_uart_protocol_exit(void);
extern int gb_sdio_protocol_init(void);
extern void gb_sdio_protocol_exit(void);
extern int gb_usb_protocol_init(void);
extern void gb_usb_protocol_exit(void);
extern int gb_i2c_protocol_init(void);
extern void gb_i2c_protocol_exit(void);
extern int gb_spi_protocol_init(void);
extern void gb_spi_protocol_exit(void);
#endif /* __GPBRIDGE_H */

View File

@ -16,6 +16,7 @@
#include <linux/mutex.h>
#include "greybus.h"
#include "gpbridge.h"
struct gb_gpio_line {
/* The following has to be an array of line_max entries */

View File

@ -13,6 +13,7 @@
#include <linux/i2c.h>
#include "greybus.h"
#include "gpbridge.h"
struct gb_i2c_device {
struct gb_connection *connection;

View File

@ -48,32 +48,6 @@ int gb_protocol_get_version(struct gb_connection *connection);
void gb_protocol_put(struct gb_protocol *protocol);
/*
* These are defined in their respective protocol source files.
* Declared here for now. They could be added via modules, or maybe
* just use initcalls (which level?).
*/
extern int gb_gpio_protocol_init(void);
extern void gb_gpio_protocol_exit(void);
extern int gb_pwm_protocol_init(void);
extern void gb_pwm_protocol_exit(void);
extern int gb_uart_protocol_init(void);
extern void gb_uart_protocol_exit(void);
extern int gb_sdio_protocol_init(void);
extern void gb_sdio_protocol_exit(void);
extern int gb_usb_protocol_init(void);
extern void gb_usb_protocol_exit(void);
extern int gb_i2c_protocol_init(void);
extern void gb_i2c_protocol_exit(void);
extern int gb_spi_protocol_init(void);
extern void gb_spi_protocol_exit(void);
/* __protocol: Pointer to struct gb_protocol */
#define gb_protocol_driver(__protocol) \
static int __init protocol_init(void) \

View File

@ -13,6 +13,7 @@
#include <linux/pwm.h>
#include "greybus.h"
#include "gpbridge.h"
struct gb_pwm_chip {
struct gb_connection *connection;

View File

@ -15,6 +15,7 @@
#include <linux/workqueue.h>
#include "greybus.h"
#include "gpbridge.h"
struct gb_sdio_host {
struct gb_connection *connection;

View File

@ -14,6 +14,7 @@
#include <linux/spi/spi.h>
#include "greybus.h"
#include "gpbridge.h"
struct gb_spi {
struct gb_connection *connection;

View File

@ -29,6 +29,7 @@
#include <linux/kdev_t.h>
#include "greybus.h"
#include "gpbridge.h"
#define GB_NUM_MINORS 16 /* 16 is is more than enough */
#define GB_NAME "ttyGB"

View File

@ -14,6 +14,7 @@
#include <linux/usb/hcd.h>
#include "greybus.h"
#include "gpbridge.h"
/* Version of the Greybus USB protocol we support */
#define GB_USB_VERSION_MAJOR 0x00