Skip to content

Commit

Permalink
media: i2c: ov7251: Make the enable GPIO optional.
Browse files Browse the repository at this point in the history
Not all implementations wire up the enable GPIO and may just tie
it to a supply rail.
Make it optional.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 authored and popcornmix committed Dec 10, 2024
1 parent 1379551 commit 359a5cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/i2c/ov7251.c
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,8 @@ static int ov7251_probe(struct i2c_client *client)
return PTR_ERR(ov7251->analog_regulator);
}

ov7251->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
ov7251->enable_gpio = devm_gpiod_get_optional(dev, "enable",
GPIOD_OUT_HIGH);
if (IS_ERR(ov7251->enable_gpio)) {
dev_err(dev, "cannot get enable gpio\n");
return PTR_ERR(ov7251->enable_gpio);
Expand Down

0 comments on commit 359a5cf

Please sign in to comment.