linux/include/linux/via-core.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
 * Copyright 2009-2010 Jonathan Corbet <[email protected]>
 * Copyright 2010 Florian Tobias Schandinat <[email protected]>
 */

#ifndef __VIA_CORE_H__
#define __VIA_CORE_H__
#include <linux/types.h>
#include <linux/io.h>
#include <linux/spinlock.h>
#include <linux/pci.h>

/*
 * A description of each known serial I2C/GPIO port.
 */
enum via_port_type {};

enum via_port_mode {};

enum viafb_i2c_adap {};
#define VIAFB_NUM_PORTS

struct via_port_cfg {};

/*
 * Allow subdevs to register suspend/resume hooks.
 */
struct viafb_pm_hooks {};

void viafb_pm_register(struct viafb_pm_hooks *hooks);
void viafb_pm_unregister(struct viafb_pm_hooks *hooks);

/*
 * This is the global viafb "device" containing stuff needed by
 * all subdevs.
 */
struct viafb_dev {};

/*
 * Interrupt management.
 */

void viafb_irq_enable(u32 mask);
void viafb_irq_disable(u32 mask);

/*
 * The global interrupt control register and its bits.
 */
#define VDE_INTERRUPT
#define VDE_I_DVISENSE
#define VDE_I_VBLANK
#define VDE_I_MCCFI
#define VDE_I_VSYNC
#define VDE_I_DMA0DDONE
#define VDE_I_DMA0TDONE
#define VDE_I_DMA1DDONE
#define VDE_I_DMA1TDONE
#define VDE_I_C1AV
#define VDE_I_HQV0
#define VDE_I_HQV1
#define VDE_I_HQV1EN
#define VDE_I_C0AV
#define VDE_I_C0VBI
#define VDE_I_C1VBI
#define VDE_I_VSYNC2
#define VDE_I_DVISNSEN
#define VDE_I_VSYNC2EN
#define VDE_I_MCCFIEN
#define VDE_I_VSYNCEN
#define VDE_I_DMA0DDEN
#define VDE_I_DMA0TDEN
#define VDE_I_DMA1DDEN
#define VDE_I_DMA1TDEN
#define VDE_I_C1AVEN
#define VDE_I_HQV0EN
#define VDE_I_C1VBIEN
#define VDE_I_LVDSSI
#define VDE_I_C0AVEN
#define VDE_I_C0VBIEN
#define VDE_I_LVDSSIEN
#define VDE_I_ENABLE

#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE)
/*
 * DMA management.
 */
int viafb_request_dma(void);
void viafb_release_dma(void);
/* void viafb_dma_copy_out(unsigned int offset, dma_addr_t paddr, int len); */
int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg);

/*
 * DMA Controller registers.
 */
#define VDMA_MR0
#define VDMA_MR_CHAIN
#define VDMA_MR_TDIE
#define VDMA_CSR0
#define VDMA_C_ENABLE
#define VDMA_C_START
#define VDMA_C_ABORT
#define VDMA_C_DONE
#define VDMA_MARL0
#define VDMA_MARH0
#define VDMA_DAR0
#define VDMA_DQWCR0
#define VDMA_TMR0
#define VDMA_DPRL0
#define VDMA_DPR_IN
#define VDMA_DPRH0
#define VDMA_PMR0

/*
 * Useful stuff that probably belongs somewhere global.
 */
#define VGA_WIDTH
#define VGA_HEIGHT
#endif /* CONFIG_VIDEO_VIA_CAMERA */

/*
 * Indexed port operations.  Note that these are all multi-op
 * functions; every invocation will be racy if you're not holding
 * reg_lock.
 */

#define VIAStatus
#define VIACR
#define VIASR
#define VIAGR
#define VIAAR

static inline u8 via_read_reg(u16 port, u8 index)
{}

static inline void via_write_reg(u16 port, u8 index, u8 data)
{}

static inline void via_write_reg_mask(u16 port, u8 index, u8 data, u8 mask)
{}

#define VIA_MISC_REG_READ
#define VIA_MISC_REG_WRITE

static inline void via_write_misc_reg_mask(u8 data, u8 mask)
{}


#endif /* __VIA_CORE_H__ */