linux/drivers/mfd/dln2.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for the Diolan DLN-2 USB adapter
 *
 * Copyright (c) 2014 Intel Corporation
 *
 * Derived from:
 *  i2c-diolan-u2c.c
 *  Copyright (c) 2010-2011 Ericsson AB
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/mfd/core.h>
#include <linux/mfd/dln2.h>
#include <linux/rculist.h>

struct dln2_header {};

struct dln2_response {};

#define DLN2_GENERIC_MODULE_ID
#define DLN2_GENERIC_CMD(cmd)
#define CMD_GET_DEVICE_VER
#define CMD_GET_DEVICE_SN

#define DLN2_HW_ID
#define DLN2_USB_TIMEOUT
#define DLN2_MAX_RX_SLOTS
#define DLN2_MAX_URBS
#define DLN2_RX_BUF_SIZE

enum dln2_handle {};

/*
 * Receive context used between the receive demultiplexer and the transfer
 * routine. While sending a request the transfer routine will look for a free
 * receive context and use it to wait for a response and to receive the URB and
 * thus the response data.
 */
struct dln2_rx_context {};

/*
 * Receive contexts for a particular DLN2 module (i2c, gpio, etc.). We use the
 * handle header field to identify the module in dln2_dev.mod_rx_slots and then
 * the echo header field to index the slots field and find the receive context
 * for a particular request.
 */
struct dln2_mod_rx_slots {};

struct dln2_dev {};

struct dln2_event_cb_entry {};

int dln2_register_event_cb(struct platform_device *pdev, u16 id,
			   dln2_event_cb_t event_cb)
{}
EXPORT_SYMBOL();

void dln2_unregister_event_cb(struct platform_device *pdev, u16 id)
{}
EXPORT_SYMBOL();

/*
 * Returns true if a valid transfer slot is found. In this case the URB must not
 * be resubmitted immediately in dln2_rx as we need the data when dln2_transfer
 * is woke up. It will be resubmitted there.
 */
static bool dln2_transfer_complete(struct dln2_dev *dln2, struct urb *urb,
				   u16 handle, u16 rx_slot)
{}

static void dln2_run_event_callbacks(struct dln2_dev *dln2, u16 id, u16 echo,
				     void *data, int len)
{}

static void dln2_rx(struct urb *urb)
{}

static void *dln2_prep_buf(u16 handle, u16 cmd, u16 echo, const void *obuf,
			   int *obuf_len, gfp_t gfp)
{}

static int dln2_send_wait(struct dln2_dev *dln2, u16 handle, u16 cmd, u16 echo,
			  const void *obuf, int obuf_len)
{}

static bool find_free_slot(struct dln2_dev *dln2, u16 handle, int *slot)
{}

static int alloc_rx_slot(struct dln2_dev *dln2, u16 handle)
{}

static void free_rx_slot(struct dln2_dev *dln2, u16 handle, int slot)
{}

static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd,
			  const void *obuf, unsigned obuf_len,
			  void *ibuf, unsigned *ibuf_len)
{}

int dln2_transfer(struct platform_device *pdev, u16 cmd,
		  const void *obuf, unsigned obuf_len,
		  void *ibuf, unsigned *ibuf_len)
{}
EXPORT_SYMBOL();

static int dln2_check_hw(struct dln2_dev *dln2)
{}

static int dln2_print_serialno(struct dln2_dev *dln2)
{}

static int dln2_hw_init(struct dln2_dev *dln2)
{}

static void dln2_free_rx_urbs(struct dln2_dev *dln2)
{}

static void dln2_stop_rx_urbs(struct dln2_dev *dln2)
{}

static void dln2_free(struct dln2_dev *dln2)
{}

static int dln2_setup_rx_urbs(struct dln2_dev *dln2,
			      struct usb_host_interface *hostif)
{}

static int dln2_start_rx_urbs(struct dln2_dev *dln2, gfp_t gfp)
{}

enum {};

static struct dln2_platform_data dln2_pdata_gpio =;

static struct mfd_cell_acpi_match dln2_acpi_match_gpio =;

/* Only one I2C port seems to be supported on current hardware */
static struct dln2_platform_data dln2_pdata_i2c =;

static struct mfd_cell_acpi_match dln2_acpi_match_i2c =;

/* Only one SPI port supported */
static struct dln2_platform_data dln2_pdata_spi =;

static struct mfd_cell_acpi_match dln2_acpi_match_spi =;

/* Only one ADC port supported */
static struct dln2_platform_data dln2_pdata_adc =;

static struct mfd_cell_acpi_match dln2_acpi_match_adc =;

static const struct mfd_cell dln2_devs[] =;

static void dln2_stop(struct dln2_dev *dln2)
{}

static void dln2_disconnect(struct usb_interface *interface)
{}

static int dln2_probe(struct usb_interface *interface,
		      const struct usb_device_id *usb_id)
{}

static int dln2_suspend(struct usb_interface *iface, pm_message_t message)
{}

static int dln2_resume(struct usb_interface *iface)
{}

static const struct usb_device_id dln2_table[] =;

MODULE_DEVICE_TABLE(usb, dln2_table);

static struct usb_driver dln2_driver =;

module_usb_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();