浏览代码

regmap: spi: Handle async writes of only one buffer

If the value is zero then assume it has been included in the register data
and don't send anything, minimising the number of interactions with the
hardware.

Signed-off-by: Mark Brown <broonie@linaro.org>
Mark Brown 12 年之前
父节点
当前提交
cd1b9dd022
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/base/regmap/regmap-spi.c

+ 2 - 1
drivers/base/regmap/regmap-spi.c

@@ -73,7 +73,8 @@ static int regmap_spi_async_write(void *context,
 
 
 	spi_message_init(&async->m);
 	spi_message_init(&async->m);
 	spi_message_add_tail(&async->t[0], &async->m);
 	spi_message_add_tail(&async->t[0], &async->m);
-	spi_message_add_tail(&async->t[1], &async->m);
+	if (val)
+		spi_message_add_tail(&async->t[1], &async->m);
 
 
 	async->m.complete = regmap_spi_complete;
 	async->m.complete = regmap_spi_complete;
 	async->m.context = async;
 	async->m.context = async;