linux/drivers/dma/qcom/hidma.c

/*
 * Qualcomm Technologies HIDMA DMA engine interface
 *
 * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

/*
 * Copyright (C) Freescale Semicondutor, Inc. 2007, 2008.
 * Copyright (C) Semihalf 2009
 * Copyright (C) Ilya Yanok, Emcraft Systems 2010
 * Copyright (C) Alexander Popov, Promcontroller 2014
 *
 * Written by Piotr Ziecik <[email protected]>. Hardware description
 * (defines, structures and comments) was taken from MPC5121 DMA driver
 * written by Hongjun Chen <[email protected]>.
 *
 * Approved as OSADL project by a majority of OSADL members and funded
 * by OSADL membership fees in 2009;  for details see www.osadl.org.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * The full GNU General Public License is included in this distribution in the
 * file called COPYING.
 */

/* Linux Foundation elects GPLv2 license only. */

#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/list.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/property.h>
#include <linux/delay.h>
#include <linux/acpi.h>
#include <linux/irq.h>
#include <linux/atomic.h>
#include <linux/pm_runtime.h>
#include <linux/msi.h>

#include "../dmaengine.h"
#include "hidma.h"

/*
 * Default idle time is 2 seconds. This parameter can
 * be overridden by changing the following
 * /sys/bus/platform/devices/QCOM8061:<xy>/power/autosuspend_delay_ms
 * during kernel boot.
 */
#define HIDMA_AUTOSUSPEND_TIMEOUT
#define HIDMA_ERR_INFO_SW
#define HIDMA_ERR_CODE_UNEXPECTED_TERMINATE
#define HIDMA_NR_DEFAULT_DESC
#define HIDMA_MSI_INTS

static inline struct hidma_dev *to_hidma_dev(struct dma_device *dmadev)
{}

static inline
struct hidma_dev *to_hidma_dev_from_lldev(struct hidma_lldev **_lldevp)
{}

static inline struct hidma_chan *to_hidma_chan(struct dma_chan *dmach)
{}

static void hidma_free(struct hidma_dev *dmadev)
{}

static unsigned int nr_desc_prm;
module_param(nr_desc_prm, uint, 0644);
MODULE_PARM_DESC();

enum hidma_cap {};

/* process completed descriptors */
static void hidma_process_completed(struct hidma_chan *mchan)
{}

/*
 * Called once for each submitted descriptor.
 * PM is locked once for each descriptor that is currently
 * in execution.
 */
static void hidma_callback(void *data)
{}

static int hidma_chan_init(struct hidma_dev *dmadev, u32 dma_sig)
{}

static void hidma_issue_task(struct tasklet_struct *t)
{}

static void hidma_issue_pending(struct dma_chan *dmach)
{}

static inline bool hidma_txn_is_success(dma_cookie_t cookie,
		dma_cookie_t last_success, dma_cookie_t last_used)
{}

static enum dma_status hidma_tx_status(struct dma_chan *dmach,
				       dma_cookie_t cookie,
				       struct dma_tx_state *txstate)
{}

/*
 * Submit descriptor to hardware.
 * Lock the PM for each descriptor we are sending.
 */
static dma_cookie_t hidma_tx_submit(struct dma_async_tx_descriptor *txd)
{}

static int hidma_alloc_chan_resources(struct dma_chan *dmach)
{}

static struct dma_async_tx_descriptor *
hidma_prep_dma_memcpy(struct dma_chan *dmach, dma_addr_t dest, dma_addr_t src,
		size_t len, unsigned long flags)
{}

static struct dma_async_tx_descriptor *
hidma_prep_dma_memset(struct dma_chan *dmach, dma_addr_t dest, int value,
		size_t len, unsigned long flags)
{}

static int hidma_terminate_channel(struct dma_chan *chan)
{}

static int hidma_terminate_all(struct dma_chan *chan)
{}

static void hidma_free_chan_resources(struct dma_chan *dmach)
{}

static int hidma_pause(struct dma_chan *chan)
{}

static int hidma_resume(struct dma_chan *chan)
{}

static irqreturn_t hidma_chirq_handler(int chirq, void *arg)
{}

#ifdef CONFIG_GENERIC_MSI_IRQ
static irqreturn_t hidma_chirq_handler_msi(int chirq, void *arg)
{}
#endif

static ssize_t hidma_show_values(struct device *dev,
				 struct device_attribute *attr, char *buf)
{}

static inline void  hidma_sysfs_uninit(struct hidma_dev *dev)
{}

static struct device_attribute*
hidma_create_sysfs_entry(struct hidma_dev *dev, char *name, int mode)
{}

static int hidma_sysfs_init(struct hidma_dev *dev)
{}

#ifdef CONFIG_GENERIC_MSI_IRQ
static void hidma_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
{}
#endif

static void hidma_free_msis(struct hidma_dev *dmadev)
{}

static int hidma_request_msi(struct hidma_dev *dmadev,
			     struct platform_device *pdev)
{}

static bool hidma_test_capability(struct device *dev, enum hidma_cap test_cap)
{}

static int hidma_probe(struct platform_device *pdev)
{}

static void hidma_shutdown(struct platform_device *pdev)
{}

static void hidma_remove(struct platform_device *pdev)
{}

#if IS_ENABLED(CONFIG_ACPI)
static const struct acpi_device_id hidma_acpi_ids[] =;
MODULE_DEVICE_TABLE(acpi, hidma_acpi_ids);
#endif

static struct platform_driver hidma_driver =;

module_platform_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();