1
0
Fork 0

MLK-23252-3 gpu: imx: lcdifv3: Support client specific pdev id

There could be multiple LCDIFv3 instances in a SoC, so client
specific pdev id is needed.  With this supported, LCDIFv3
instance1(for MIPI DSI) and instance2(for LDB) in i.MX8MP SoC
can add client pdev at the same time without id confliction
and thus can be both probed successfully.
As the i.MX8MP EVK bootloader can do splash screen with MIPI DSI,
we need properly reset LCDIFv3 instance1 in the LCDIFv3 driver,
otherwise, the LCDIFv3 instance2 cannot work(the reason behind
needs investigation).  This also requires the two instances can
be probed at same time so that instance1 can be reset.

Reviewed-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Liu Ying 2020-02-12 13:25:28 +08:00
parent a01340fef7
commit 74b7528731
1 changed files with 9 additions and 2 deletions

View File

@ -516,9 +516,12 @@ static void platform_device_unregister_children(struct platform_device *pdev)
device_for_each_child(&pdev->dev, NULL, platform_remove_device_fn);
}
static DEFINE_MUTEX(lcdifv3_client_id_mutex);
static int lcdifv3_client_id;
static int lcdifv3_add_client_devices(struct lcdifv3_soc *lcdifv3)
{
int ret = 0, i;
int ret = 0, i, id;
struct device *dev = lcdifv3->dev;
struct platform_device *pdev = NULL;
struct device_node *of_node;
@ -532,7 +535,11 @@ static int lcdifv3_add_client_devices(struct lcdifv3_soc *lcdifv3)
}
of_node_put(of_node);
pdev = platform_device_alloc(client_reg[i].name, i);
mutex_lock(&lcdifv3_client_id_mutex);
id = lcdifv3_client_id++;
mutex_unlock(&lcdifv3_client_id_mutex);
pdev = platform_device_alloc(client_reg[i].name, id);
if (!pdev) {
dev_err(dev, "Can't allocate port pdev\n");
ret = -ENOMEM;