From 014884264fe8fbf37c571f579ed644d1b2e3483e Mon Sep 17 00:00:00 2001
From: dylad <dylan.laduranty@mesotic.com>
Date: Fri, 14 Sep 2018 14:05:39 +0200
Subject: [PATCH] =?UTF-8?q?drivers/tsl2561:=20add=20missing=20acquire?=
 =?UTF-8?q?=E2=88=95release=20functions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 drivers/tsl2561/tsl2561.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/tsl2561/tsl2561.c b/drivers/tsl2561/tsl2561.c
index 05260eb47e..abb70b9272 100644
--- a/drivers/tsl2561/tsl2561.c
+++ b/drivers/tsl2561/tsl2561.c
@@ -84,6 +84,7 @@ int tsl2561_init(tsl2561_t *dev, const tsl2561_params_t *params)
 #endif
 
     _disable(dev);
+    i2c_release(DEV_I2C);
 
     return TSL2561_OK;
 }
@@ -212,6 +213,8 @@ static void _disable(const tsl2561_t *dev)
 
 static void _read_data(const tsl2561_t *dev, uint16_t *full, uint16_t *ir)
 {
+    /* acquire bus */
+    i2c_acquire(DEV_I2C);
     /* Enable the device */
     _enable(dev);
 
@@ -247,6 +250,8 @@ static void _read_data(const tsl2561_t *dev, uint16_t *full, uint16_t *ir)
 
     /* Turn the device off to save power */
     _disable(dev);
+    /* release bus */
+    i2c_release(DEV_I2C);
 }
 
 static void _print_init_info(const tsl2561_t *dev)
-- 
GitLab