LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Adam Ward <adam.ward.opensource@diasemi.com>
To: Samuel Ortiz <sameo@linux.intel.com>, Lee Jones <lee.jones@linaro.org>
Cc: Support Opensource <support.opensource@diasemi.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH v1 1/2] mfd: da9052: Fix register access via SPI
Date: Wed, 4 Mar 2015 16:13:12 +0000	[thread overview]
Message-ID: <856964c7285656c88f23d0bcd5dae8519c2a1227.1425490309.git.adam.ward.opensource@diasemi.com> (raw)
In-Reply-To: <cover.1425490309.git.adam.ward.opensource@diasemi.com>

The range of registers used by this driver exceeds that available
via SPI with no paging (127), so we have to override the values
from the default config which is set-up for I2C access.
Also change SPI settings to match device's recommended OTP values.

Signed-off-by: Adam Ward <adam.ward.opensource@diasemi.com>
Tested-by: Adam Ward <adam.ward.opensource@diasemi.com>
---
 drivers/mfd/da9052-spi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c
index 45ae0b7..b5de8a6 100644
--- a/drivers/mfd/da9052-spi.c
+++ b/drivers/mfd/da9052-spi.c
@@ -32,7 +32,7 @@ static int da9052_spi_probe(struct spi_device *spi)
 	if (!da9052)
 		return -ENOMEM;

-	spi->mode = SPI_MODE_0 | SPI_CPOL;
+	spi->mode = SPI_MODE_0;
 	spi->bits_per_word = 8;
 	spi_setup(spi);

@@ -43,6 +43,10 @@ static int da9052_spi_probe(struct spi_device *spi)

 	config = da9052_regmap_config;
 	config.read_flag_mask = 1;
+	config.reg_bits = 7;
+	config.pad_bits = 1;
+	config.val_bits = 8;
+	config.use_single_rw = 1;

 	da9052->regmap = devm_regmap_init_spi(spi, &config);
 	if (IS_ERR(da9052->regmap)) {
-- 
end-of-patch for mfd: da9052: Fix SPI access and IRQ config


  reply	other threads:[~2015-03-04 17:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 17:31 [PATCH v1 0/2] mfd: da9052: Fix SPI access and IRQ config Adam Ward
2015-03-04 16:13 ` Adam Ward [this message]
2015-03-04 18:44   ` [PATCH v1 1/2] mfd: da9052: Fix register access via SPI Lee Jones
2015-03-04 16:13 ` [PATCH v1 2/2] mfd: da9052: Register ability of device to cause a wake-up interrupt Adam Ward
2015-03-04 18:45   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=856964c7285656c88f23d0bcd5dae8519c2a1227.1425490309.git.adam.ward.opensource@diasemi.com \
    --to=adam.ward.opensource@diasemi.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=support.opensource@diasemi.com \
    --subject='Re: [PATCH v1 1/2] mfd: da9052: Fix register access via SPI' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).