linux/include/linux/mfd/kempld.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Kontron PLD driver definitions
 *
 * Copyright (c) 2010-2012 Kontron Europe GmbH
 * Author: Michael Brunner <[email protected]>
 */

#ifndef _LINUX_MFD_KEMPLD_H_
#define _LINUX_MFD_KEMPLD_H_

/* kempld register definitions */
#define KEMPLD_IOINDEX
#define KEMPLD_IODATA
#define KEMPLD_MUTEX_KEY
#define KEMPLD_VERSION
#define KEMPLD_VERSION_LSB
#define KEMPLD_VERSION_MSB
#define KEMPLD_VERSION_GET_MINOR(x)
#define KEMPLD_VERSION_GET_MAJOR(x)
#define KEMPLD_VERSION_GET_NUMBER(x)
#define KEMPLD_VERSION_GET_TYPE(x)
#define KEMPLD_BUILDNR
#define KEMPLD_BUILDNR_LSB
#define KEMPLD_BUILDNR_MSB
#define KEMPLD_FEATURE
#define KEMPLD_FEATURE_LSB
#define KEMPLD_FEATURE_MSB
#define KEMPLD_FEATURE_BIT_I2C
#define KEMPLD_FEATURE_BIT_WATCHDOG
#define KEMPLD_FEATURE_BIT_GPIO
#define KEMPLD_FEATURE_MASK_UART
#define KEMPLD_FEATURE_BIT_NMI
#define KEMPLD_FEATURE_BIT_SMI
#define KEMPLD_FEATURE_BIT_SCI
#define KEMPLD_SPEC
#define KEMPLD_SPEC_GET_MINOR(x)
#define KEMPLD_SPEC_GET_MAJOR(x)
#define KEMPLD_IRQ_GPIO
#define KEMPLD_IRQ_I2C
#define KEMPLD_CFG
#define KEMPLD_CFG_GPIO_I2C_MUX
#define KEMPLD_CFG_BIOS_WP

#define KEMPLD_CLK

#define KEMPLD_TYPE_RELEASE
#define KEMPLD_TYPE_DEBUG
#define KEMPLD_TYPE_CUSTOM

#define KEMPLD_VERSION_LEN

/**
 * struct kempld_info - PLD device information structure
 * @major:	PLD major revision
 * @minor:	PLD minor revision
 * @buildnr:	PLD build number
 * @number:	PLD board specific index
 * @type:	PLD type
 * @spec_major:	PLD FW specification major revision
 * @spec_minor:	PLD FW specification minor revision
 * @version:	PLD version string
 */
struct kempld_info {};

/**
 * struct kempld_device_data - Internal representation of the PLD device
 * @io_base:		Pointer to the IO memory
 * @io_index:		Pointer to the IO index register
 * @io_data:		Pointer to the IO data register
 * @pld_clock:		PLD clock frequency
 * @feature_mask:	PLD feature mask
 * @dev:		Pointer to kernel device structure
 * @info:		KEMPLD info structure
 * @lock:		PLD mutex
 */
struct kempld_device_data {};

/**
 * struct kempld_platform_data - PLD hardware configuration structure
 * @pld_clock:			PLD clock frequency
 * @gpio_base			GPIO base pin number
 * @ioresource:			IO addresses of the PLD
 * @get_mutex:			PLD specific get_mutex callback
 * @release_mutex:		PLD specific release_mutex callback
 * @get_info:			PLD specific get_info callback
 * @register_cells:		PLD specific register_cells callback
 */
struct kempld_platform_data {};

extern void kempld_get_mutex(struct kempld_device_data *pld);
extern void kempld_release_mutex(struct kempld_device_data *pld);
extern u8 kempld_read8(struct kempld_device_data *pld, u8 index);
extern void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data);
extern u16 kempld_read16(struct kempld_device_data *pld, u8 index);
extern void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data);
extern u32 kempld_read32(struct kempld_device_data *pld, u8 index);
extern void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data);

#endif /* _LINUX_MFD_KEMPLD_H_ */