/* According to the MAX6957AAX datasheet, we should release the chip select halfway through the read sequence, when the actual register value is read; but the WORK_92105 hardware prevents the MAX6957AAX SPI OUT from reaching the LPC32XX SIP MISO if chip is not selected. so let's release the CS an hold it again while reading the result.  */
static uint8_t max6957aax_read(uint8_t reg)
/* According to the MAX6957AAX datasheet, we should release the chip select halfway through the read sequence, when the actual register value is read; but the WORK_92105 hardware prevents the MAX6957AAX SPI OUT from reaching the LPC32XX SIP MISO if chip is not selected. so let's release the CS an hold it again while reading the result.  */
static uint8_t max6957aax_read(uint8_t reg)
{
	uint8_t dout[2], din[2];
	dout[0] = reg | 0x80;
	dout[1] = 0;
	gpio_set_value(GPO_15, 0);
	spi_xfer(slave, 16, dout, dout, SPI_XFER_BEGIN | SPI_XFER_END);
	gpio_set_value(GPO_15, 1);
	din[0] = 0;
	din[1] = 0;
	gpio_set_value(GPO_15, 0);
	spi_xfer(slave, 16, din, din, SPI_XFER_BEGIN | SPI_XFER_END);
	gpio_set_value(GPO_15, 1);
	return din[1];
}