Changes in 4.9.237 ARM: dts: socfpga: fix register entry for timer3 on Arria10 RDMA/rxe: Fix memleak in rxe_mem_init_user RDMA/rxe: Drop pointless checks in rxe_init_ports scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA drivers/net/wan/lapbether: Added needed_tailroom NFC: st95hf: Fix memleak in st95hf_in_send_cmd firestream: Fix memleak in fs_open ALSA: hda: Fix 2 channel swapping for Tegra drivers/net/wan/lapbether: Set network_header before transmitting xfs: initialize the shortform attr header padding entry irqchip/eznps: Fix build error for !ARC700 builds drivers/net/wan/hdlc_cisco: Add hard_header_len ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled gcov: Disable gcov build with GCC 10 iio: adc: mcp3422: fix locking scope iio: adc: mcp3422: fix locking on error path iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set iio:light:ltr501 Fix timestamp alignment issue. iio:accel:bmc150-accel: Fix timestamp alignment and prevent data leak. iio:adc:ina2xx Fix timestamp alignment issue. iio:adc:ti-adc081c Fix alignment and data leak issues drivers: iio: magnetometer: Fix sparse endianness warnings cast to restricted __be16 iio:magnetometer:ak8975 Fix alignment and data leak issues. iio:light:max44000 Fix timestamp alignment and prevent data leak. iio: accel: kxsd9: Fix alignment of local buffer. iio:accel:mma7455: Fix timestamp alignment and prevent data leak. iio:accel:mma8452: Fix timestamp alignment and prevent data leak. USB: core: add helpers to retrieve endpoints staging: wlan-ng: fix out of bounds read in prism2sta_probe_usb() btrfs: fix wrong address when faulting in pages in the search ioctl regulator: push allocation in set_consumer_device_supply() out of lock scsi: target: iscsi: Fix data digest calculation scsi: target: iscsi: Fix hang in iscsit_access_np() when getting tpg->np_login_sem rbd: require global CAP_SYS_ADMIN for mapping and unmapping fbcon: remove soft scrollback code fbcon: remove now unusued 'softback_lines' cursor() argument vgacon: remove software scrollback support KVM: VMX: Don't freeze guest when event delivery causes an APIC-access exit video: fbdev: fix OOB read in vga_8planes_imageblit() staging: greybus: audio: fix uninitialized value issue usb: core: fix slab-out-of-bounds Read in read_descriptors USB: serial: ftdi_sio: add IDs for Xsens Mti USB converter USB: serial: option: add support for SIM7070/SIM7080/SIM7090 modules usb: Fix out of sync data toggle if a configured device is reconfigured IB/rxe: Remove a pointless indirection layer RDMA/rxe: Fix the parent sysfs read when the interface has 15 chars gcov: add support for GCC 10.1 net: handle the return value of pskb_carve_frag_list() correctly NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery spi: spi-loopback-test: Fix out-of-bounds read SUNRPC: stop printk reading past end of string rapidio: Replace 'select' DMAENGINES 'with depends on' i2c: algo: pca: Reapply i2c bus settings after reset clk: rockchip: Fix initialization of mux_pll_src_4plls_p Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload MIPS: SNI: Fix MIPS_L1_CACHE_SHIFT perf test: Free formats for perf pmu parse test fbcon: Fix user font detection test at fbcon_resize(). MIPS: SNI: Fix spurious interrupts drm/mediatek: Add exception handing in mtk_drm_probe() if component init fail USB: quirks: Add USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for BYD zhaoxin notebook USB: UAS: fix disconnect by unplugging a hub usblp: fix race between disconnect() and read() Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists serial: 8250_pci: Add Realtek 816a and 816b ehci-hcd: Move include to keep CRC stable powerpc/dma: Fix dma_map_ops::get_required_mask x86/defconfig: Enable CONFIG_USB_XHCI_HCD=y Linux 4.9.237 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I675fbd4859f56d7dfefa3f23bcf61e38c3bebdc1
87 lines
2.8 KiB
C
87 lines
2.8 KiB
C
#ifndef _LINUX_I2C_ALGO_PCA_H
|
|
#define _LINUX_I2C_ALGO_PCA_H
|
|
|
|
/* Chips known to the pca algo */
|
|
#define I2C_PCA_CHIP_9564 0x00
|
|
#define I2C_PCA_CHIP_9665 0x01
|
|
|
|
/* Internal period for PCA9665 oscilator */
|
|
#define I2C_PCA_OSC_PER 3 /* e10-8s */
|
|
|
|
/* Clock speeds for the bus for PCA9564*/
|
|
#define I2C_PCA_CON_330kHz 0x00
|
|
#define I2C_PCA_CON_288kHz 0x01
|
|
#define I2C_PCA_CON_217kHz 0x02
|
|
#define I2C_PCA_CON_146kHz 0x03
|
|
#define I2C_PCA_CON_88kHz 0x04
|
|
#define I2C_PCA_CON_59kHz 0x05
|
|
#define I2C_PCA_CON_44kHz 0x06
|
|
#define I2C_PCA_CON_36kHz 0x07
|
|
|
|
/* PCA9564 registers */
|
|
#define I2C_PCA_STA 0x00 /* STATUS Read Only */
|
|
#define I2C_PCA_TO 0x00 /* TIMEOUT Write Only */
|
|
#define I2C_PCA_DAT 0x01 /* DATA Read/Write */
|
|
#define I2C_PCA_ADR 0x02 /* OWN ADR Read/Write */
|
|
#define I2C_PCA_CON 0x03 /* CONTROL Read/Write */
|
|
|
|
/* PCA9665 registers */
|
|
#define I2C_PCA_INDPTR 0x00 /* INDIRECT Pointer Write Only */
|
|
#define I2C_PCA_IND 0x02 /* INDIRECT Read/Write */
|
|
|
|
/* PCA9665 indirect registers */
|
|
#define I2C_PCA_ICOUNT 0x00 /* Byte Count for buffered mode */
|
|
#define I2C_PCA_IADR 0x01 /* OWN ADR */
|
|
#define I2C_PCA_ISCLL 0x02 /* SCL LOW period */
|
|
#define I2C_PCA_ISCLH 0x03 /* SCL HIGH period */
|
|
#define I2C_PCA_ITO 0x04 /* TIMEOUT */
|
|
#define I2C_PCA_IPRESET 0x05 /* Parallel bus reset */
|
|
#define I2C_PCA_IMODE 0x06 /* I2C Bus mode */
|
|
|
|
/* PCA9665 I2C bus mode */
|
|
#define I2C_PCA_MODE_STD 0x00 /* Standard mode */
|
|
#define I2C_PCA_MODE_FAST 0x01 /* Fast mode */
|
|
#define I2C_PCA_MODE_FASTP 0x02 /* Fast Plus mode */
|
|
#define I2C_PCA_MODE_TURBO 0x03 /* Turbo mode */
|
|
|
|
|
|
#define I2C_PCA_CON_AA 0x80 /* Assert Acknowledge */
|
|
#define I2C_PCA_CON_ENSIO 0x40 /* Enable */
|
|
#define I2C_PCA_CON_STA 0x20 /* Start */
|
|
#define I2C_PCA_CON_STO 0x10 /* Stop */
|
|
#define I2C_PCA_CON_SI 0x08 /* Serial Interrupt */
|
|
#define I2C_PCA_CON_CR 0x07 /* Clock Rate (MASK) */
|
|
|
|
/**
|
|
* struct pca_i2c_bus_settings - The configured PCA i2c bus settings
|
|
* @mode: Configured i2c bus mode
|
|
* @tlow: Configured SCL LOW period
|
|
* @thi: Configured SCL HIGH period
|
|
* @clock_freq: The configured clock frequency
|
|
*/
|
|
struct pca_i2c_bus_settings {
|
|
int mode;
|
|
int tlow;
|
|
int thi;
|
|
int clock_freq;
|
|
};
|
|
|
|
struct i2c_algo_pca_data {
|
|
void *data; /* private low level data */
|
|
void (*write_byte) (void *data, int reg, int val);
|
|
int (*read_byte) (void *data, int reg);
|
|
int (*wait_for_completion) (void *data);
|
|
void (*reset_chip) (void *data);
|
|
/* For PCA9564, use one of the predefined frequencies:
|
|
* 330000, 288000, 217000, 146000, 88000, 59000, 44000, 36000
|
|
* For PCA9665, use the frequency you want here. */
|
|
unsigned int i2c_clock;
|
|
unsigned int chip;
|
|
struct pca_i2c_bus_settings bus_settings;
|
|
};
|
|
|
|
int i2c_pca_add_bus(struct i2c_adapter *);
|
|
int i2c_pca_add_numbered_bus(struct i2c_adapter *);
|
|
|
|
#endif /* _LINUX_I2C_ALGO_PCA_H */
|