firmware: ti_sci: Add support to get TISCI handle using of_phandle
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 30 Apr 2019 10:12:17 +0000 (15:42 +0530)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 1 May 2019 09:40:08 +0000 (10:40 +0100)
commit905c30477f4d88ea535c6970c50bbb159d733249
treefa0f1cd94c6d4343363fdb98c6ebc2224c2df440
parent89626d4bad8199367e2085fd2408b4d63df79f43
firmware: ti_sci: Add support to get TISCI handle using of_phandle

TISCI has been updated to have support for Resource management(like
interrupts etc..). And there can be multiple device instances of a
resource type in a SoC. So every driver corresponding to a resource type
should get a TISCI handle so that it can make TISCI calls. And each
DT node corresponding to a device should exist under its corresponding
bus node as per the SoC architecture.

But existing apis in TISCI library assumes that all TISCI users are
child nodes of TISCI. Which is not true in the above case. So introduce
(devm_)ti_sci_get_by_phandle() apis that can be used by TISCI users
to get TISCI handle using of phandle property.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/firmware/ti_sci.c
include/linux/soc/ti/ti_sci_protocol.h