From 931e06de64100e28031627964321da3fdb449378 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 4 May 2010 10:07:53 +0000 Subject: i.MX31/Gigabeat S: Actually enable DPTC which can set optimal voltage for 528MHz. Requires an SPI and PMIC interface rework because of the low-latency needs for the DPTC to work best with minimal panicing. SPI can work with multitasking and asynchronously from interrupt handlers or normal code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25800 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/mc13783.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'firmware/export/mc13783.h') diff --git a/firmware/export/mc13783.h b/firmware/export/mc13783.h index 0a83527c57..e513fa1717 100644 --- a/firmware/export/mc13783.h +++ b/firmware/export/mc13783.h @@ -21,6 +21,8 @@ #ifndef _MC13783_H_ #define _MC13783_H_ +#include "spi-imx31.h" + enum mc13783_regs_enum { MC13783_INTERRUPT_STATUS0 = 0, @@ -1261,11 +1263,21 @@ void mc13783_init(void); void mc13783_close(void); uint32_t mc13783_set(unsigned address, uint32_t bits); uint32_t mc13783_clear(unsigned address, uint32_t bits); +uint32_t mc13783_read(unsigned address); int mc13783_write(unsigned address, uint32_t data); uint32_t mc13783_write_masked(unsigned address, uint32_t data, uint32_t mask); -int mc13783_write_regset(const unsigned char *regs, const uint32_t *data, int count); -uint32_t mc13783_read(unsigned address); -int mc13783_read_regset(const unsigned char *regs, uint32_t *buffer, int count); +/* buffer must be available as packet workspace */ +int mc13783_read_regs(const unsigned char *regs, uint32_t *buffer, int count); +/* buffer must be available as packet workspace */ +int mc13783_write_regs(const unsigned char *regs, uint32_t *buffer, int count); +/* buffer must be available as packet workspace */ +bool mc13783_read_async(struct spi_transfer_desc *xfer, + const unsigned char *regs, uint32_t *buffer, + int count, spi_transfer_cb_fn_type callback); +/* buffer must be available as packet workspace */ +bool mc13783_write_async(struct spi_transfer_desc *xfer, + const unsigned char *regs, uint32_t *buffer, + int count, spi_transfer_cb_fn_type callback); #define MC13783_DATA_ERROR UINT32_MAX -- cgit v1.2.3