On 5/12/2017 16:39, Linus Walleij wrote:
On Mon, Dec 4, 2017 at 1:36 PM, Wolfram Sang
<[email protected]> wrote:
This will be needed when we want to create STOP conditions, too, later.
Create the needed fields and populate them for the GPIO case if the GPIO
is set to output.
Cc: Phil Reid <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Jarkko Nikula <[email protected]>
Cc: Claudio Foellmi <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
(...)
#include <linux/errno.h>
+#include <linux/gpio.h>
Please no.
+ if (gpiod_get_direction(bri->sda_gpiod) ==
GPIOF_DIR_OUT)
+ bri->set_sda = set_sda_gpio_value;
Just compare it to zero. if (!gpiod_get_direction())
This flag is only for requesting GPIOs in the old API.
We didn't add a define in the new API, it seemed overengineered.
Perhaps the docs need updating?
as of 4.15-rc2 it says
* Return GPIOF_DIR_IN or GPIOF_DIR_OUT, or an error code in case of error.
I can submit something if you wish.
--
Regards
Phil Reid