Skip to content

Commit cfe4d57

Browse files
committed
Merge branch 'linux-6.6-trunk/at91/csi2host' into linux-6.6-mchp
2 parents f813318 + 0d0dcb7 commit cfe4d57

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

drivers/media/platform/dwc/dw-dphy-plat.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ static struct phy_provider *phy_provider;
2727
static u8 get_config_8l(struct device *dev, struct dw_dphy_rx *dphy)
2828
{
2929
if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
30-
dphy->config_8l = of_get_gpio(dev->of_node, 0);
31-
if (!gpio_is_valid(dphy->config_8l)) {
32-
dev_warn(dev,
33-
"failed to parse 8l config, default is 0\n");
34-
dphy->config_8l = 0;
30+
struct gpio_desc *conf;
31+
32+
conf = devm_fwnode_gpiod_get_index(dev, dev->fwnode, "config",
33+
0, GPIOD_IN,
34+
fwnode_get_name(dev->fwnode));
35+
if (IS_ERR(conf)) {
36+
dev_warn(dev, "8L config parse err, default is 4L\n");
37+
dphy->config_8l = CTRL_4_LANES;
3538
}
3639
} else {
3740
struct dw_phy_pdata *pdata = dev->platform_data;

drivers/media/platform/dwc/dw-dphy-rx.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,21 @@ u8 dw_dphy_setup_config(struct dw_dphy_rx *dphy)
6666
{
6767
#if IS_ENABLED(CONFIG_DWC_MIPI_TC_DPHY_GEN3)
6868
int ret;
69+
struct gpio_desc *config_gpio;
6970

7071
if (dphy->max_lanes == CTRL_4_LANES) {
7172
dev_vdbg(&dphy->phy->dev, "CONFIG 4L\n");
7273
return CTRL_4_LANES;
7374
}
7475
if (IS_ENABLED(CONFIG_OF)) {
75-
ret = gpio_request(dphy->config_8l, "config");
76-
if (ret < 0) {
76+
config_gpio = devm_gpiod_get(&dphy->phy->dev, "config",
77+
GPIOD_IN);
78+
if (IS_ERR(config_gpio)) {
7779
dev_vdbg(&dphy->phy->dev,
78-
"could not acquire config (err=%d)\n", ret);
79-
return ret;
80+
"8L config parse err, default 4L");
81+
return CTRL_4_LANES;
8082
}
81-
ret = gpio_get_value(dphy->config_8l);
82-
gpio_free(dphy->config_8l);
83+
ret = gpiod_get_value(config_gpio);
8384
} else {
8485
ret = dphy->config_8l;
8586
}

0 commit comments

Comments
 (0)