mbox series

[V7,0/7] dmaengine: qcom_hidma: add support for bugfixed HW

Message ID 1512681031-11343-1-git-send-email-okaya@codeaurora.org
Headers show
Series dmaengine: qcom_hidma: add support for bugfixed HW | expand

Message

Sinan Kaya Dec. 7, 2017, 9:10 p.m. UTC
Introduce new ACPI and OF device ids for thw HW along with the helper
functions.

Changes from v6:
* add const to the device callback parameter in fwnode.
* reorganize the callbacks in the code
* rename get_match_data() as device_get_match_data()
* place pointer checks into acpi_get_match_data()

Sinan Kaya (7):
  Documentation: DT: qcom_hidma: Bump HW revision for the bugfixed HW
  ACPI / bus: Introduce acpi_get_match_data() function
  device property: Introduce a common API to fetch device match data
  OF: properties: Implement get_match_data() callback
  ACPI: properties: Implement get_match_data() callback
  dmaengine: qcom_hidma: Add support for the new revision
  dmaengine: qcom_hidma: Add identity register support

 .../devicetree/bindings/dma/qcom_hidma_mgmt.txt    |  4 +--
 drivers/acpi/bus.c                                 | 18 ++++++++++
 drivers/acpi/property.c                            |  8 +++++
 drivers/base/property.c                            |  7 ++++
 drivers/dma/qcom/hidma.c                           | 41 ++++++++++------------
 drivers/of/property.c                              |  8 +++++
 include/linux/acpi.h                               |  6 ++++
 include/linux/fwnode.h                             |  4 +++
 include/linux/property.h                           |  2 ++
 9 files changed, 74 insertions(+), 24 deletions(-)

Comments

Rafael J. Wysocki Dec. 8, 2017, 1:48 p.m. UTC | #1
On Thu, Dec 7, 2017 at 10:10 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> Introduce new ACPI and OF device ids for thw HW along with the helper
> functions.
>
> Changes from v6:
> * add const to the device callback parameter in fwnode.
> * reorganize the callbacks in the code
> * rename get_match_data() as device_get_match_data()
> * place pointer checks into acpi_get_match_data()
>
> Sinan Kaya (7):
>   Documentation: DT: qcom_hidma: Bump HW revision for the bugfixed HW
>   ACPI / bus: Introduce acpi_get_match_data() function
>   device property: Introduce a common API to fetch device match data
>   OF: properties: Implement get_match_data() callback
>   ACPI: properties: Implement get_match_data() callback
>   dmaengine: qcom_hidma: Add support for the new revision
>   dmaengine: qcom_hidma: Add identity register support
>
>  .../devicetree/bindings/dma/qcom_hidma_mgmt.txt    |  4 +--
>  drivers/acpi/bus.c                                 | 18 ++++++++++
>  drivers/acpi/property.c                            |  8 +++++
>  drivers/base/property.c                            |  7 ++++
>  drivers/dma/qcom/hidma.c                           | 41 ++++++++++------------
>  drivers/of/property.c                              |  8 +++++
>  include/linux/acpi.h                               |  6 ++++
>  include/linux/fwnode.h                             |  4 +++
>  include/linux/property.h                           |  2 ++
>  9 files changed, 74 insertions(+), 24 deletions(-)
>
> --

The series is fine by me, by how do you want to route it?

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sinan Kaya Dec. 8, 2017, 2:44 p.m. UTC | #2
On 12/8/2017 8:48 AM, Rafael J. Wysocki wrote:
> The series is fine by me, by how do you want to route it?

Probably through the DMA engine route as it has pieces that didn't get any
review from Vinod yet.

Vinod,

Do you have any preference?

Sinan
Rafael J. Wysocki Dec. 8, 2017, 2:51 p.m. UTC | #3
On Thu, Dec 7, 2017 at 10:10 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> OF has of_device_get_match_data() function to extract driver specific data
> structure. Add a similar function for ACPI.
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/acpi/bus.c   | 18 ++++++++++++++++++
>  include/linux/acpi.h |  6 ++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 4d0979e..f87ed3b 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -785,6 +785,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
>  }
>  EXPORT_SYMBOL_GPL(acpi_match_device);
>
> +void *acpi_get_match_data(const struct device *dev)
> +{
> +       const struct acpi_device_id *match;
> +
> +       if (!dev->driver)
> +               return NULL;
> +
> +       if (!dev->driver->acpi_match_table)
> +               return NULL;

You can safely check dev->driver and this in the same statement (as
long as the first check to be made is on the left).

> +
> +       match = acpi_match_device(dev->driver->acpi_match_table, dev);
> +       if (!match)
> +               return NULL;
> +
> +       return (void *)match->driver_data;
> +}
> +EXPORT_SYMBOL_GPL(acpi_get_match_data);
> +
>  int acpi_match_device_ids(struct acpi_device *device,
>                           const struct acpi_device_id *ids)
>  {
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 502af53..a927260 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -584,6 +584,7 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
>  const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
>                                                const struct device *dev);
>
> +void *acpi_get_match_data(const struct device *dev);
>  extern bool acpi_driver_match_device(struct device *dev,
>                                      const struct device_driver *drv);
>  int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
> @@ -755,6 +756,11 @@ static inline const struct acpi_device_id *acpi_match_device(
>         return NULL;
>  }
>
> +static inline void *acpi_get_match_data(const struct device *dev)
> +{
> +       return NULL;
> +}
> +
>  static inline bool acpi_driver_match_device(struct device *dev,
>                                             const struct device_driver *drv)
>  {
> --

But anyway

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki Dec. 8, 2017, 2:51 p.m. UTC | #4
On Thu, Dec 7, 2017 at 10:10 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> Now that we have a get_match_data() callback as part of the firmware node,
> implement the ACPI specific piece for it.
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/acpi/property.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index e26ea20..466d150 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1271,9 +1271,17 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
>         return 0;
>  }
>
> +static void *
> +acpi_fwnode_device_get_match_data(const struct fwnode_handle *fwnode,
> +                                 const struct device *dev)
> +{
> +       return acpi_get_match_data(dev);
> +}
> +
>  #define DECLARE_ACPI_FWNODE_OPS(ops) \
>         const struct fwnode_operations ops = {                          \
>                 .device_is_available = acpi_fwnode_device_is_available, \
> +               .device_get_match_data = acpi_fwnode_device_get_match_data, \
>                 .property_present = acpi_fwnode_property_present,       \
>                 .property_read_int_array =                              \
>                         acpi_fwnode_property_read_int_array,            \
> --

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vinod Koul Dec. 10, 2017, 4:39 p.m. UTC | #5
On Fri, Dec 08, 2017 at 09:44:46AM -0500, Sinan Kaya wrote:
> On 12/8/2017 8:48 AM, Rafael J. Wysocki wrote:
> > The series is fine by me, by how do you want to route it?
> 
> Probably through the DMA engine route as it has pieces that didn't get any
> review from Vinod yet.
> 
> Vinod,
> 
> Do you have any preference?

Yeah sure sounds okay to me as DMA parts are dependent on these.
Rafael if you need an immutable tag to pull this, let me know.

Thanks
Vinod Koul Dec. 12, 2017, 5:38 a.m. UTC | #6
On Thu, Dec 07, 2017 at 04:10:24PM -0500, Sinan Kaya wrote:
> Introduce new ACPI and OF device ids for thw HW along with the helper
> functions.
> 
> Changes from v6:
> * add const to the device callback parameter in fwnode.
> * reorganize the callbacks in the code
> * rename get_match_data() as device_get_match_data()
> * place pointer checks into acpi_get_match_data()

This fails for me at 3rd patch. I am on -rc1 is there a dependency?
Rafael J. Wysocki Dec. 12, 2017, 12:36 p.m. UTC | #7
On Tue, Dec 12, 2017 at 6:38 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> On Thu, Dec 07, 2017 at 04:10:24PM -0500, Sinan Kaya wrote:
>> Introduce new ACPI and OF device ids for thw HW along with the helper
>> functions.
>>
>> Changes from v6:
>> * add const to the device callback parameter in fwnode.
>> * reorganize the callbacks in the code
>> * rename get_match_data() as device_get_match_data()
>> * place pointer checks into acpi_get_match_data()
>
> This fails for me at 3rd patch. I am on -rc1 is there a dependency?

There shouldn't be any.

According to git, all changes to the files touched by the [3/7] are in
-rc1 already.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sinan Kaya Dec. 13, 2017, 12:09 a.m. UTC | #8
On 12/12/2017 7:36 AM, Rafael J. Wysocki wrote:
> On Tue, Dec 12, 2017 at 6:38 AM, Vinod Koul <vinod.koul@intel.com> wrote:
>> On Thu, Dec 07, 2017 at 04:10:24PM -0500, Sinan Kaya wrote:
>>> Introduce new ACPI and OF device ids for thw HW along with the helper
>>> functions.
>>>
>>> Changes from v6:
>>> * add const to the device callback parameter in fwnode.
>>> * reorganize the callbacks in the code
>>> * rename get_match_data() as device_get_match_data()
>>> * place pointer checks into acpi_get_match_data()
>>
>> This fails for me at 3rd patch. I am on -rc1 is there a dependency?
> 
> There shouldn't be any.
> 
> According to git, all changes to the files touched by the [3/7] are in
> -rc1 already.
> 

Let me know if you were able to resolve the conflict. I can rebase against
a development tree if you can point me to there.
Sinan Kaya Dec. 13, 2017, 12:44 a.m. UTC | #9
On 12/12/2017 7:09 PM, Sinan Kaya wrote:
> On 12/12/2017 7:36 AM, Rafael J. Wysocki wrote:
>> On Tue, Dec 12, 2017 at 6:38 AM, Vinod Koul <vinod.koul@intel.com> wrote:
>>> On Thu, Dec 07, 2017 at 04:10:24PM -0500, Sinan Kaya wrote:
>>>> Introduce new ACPI and OF device ids for thw HW along with the helper
>>>> functions.
>>>>
>>>> Changes from v6:
>>>> * add const to the device callback parameter in fwnode.
>>>> * reorganize the callbacks in the code
>>>> * rename get_match_data() as device_get_match_data()
>>>> * place pointer checks into acpi_get_match_data()
>>>
>>> This fails for me at 3rd patch. I am on -rc1 is there a dependency?
>>
>> There shouldn't be any.
>>
>> According to git, all changes to the files touched by the [3/7] are in
>> -rc1 already.
>>
> 
> Let me know if you were able to resolve the conflict. I can rebase against
> a development tree if you can point me to there.
> 

Apparently, my patches were based of 4.14 kernel. 

I just rebased to 4.15-rc1.

I can post a new version. Let me know.
Vinod Koul Dec. 13, 2017, 3:19 a.m. UTC | #10
On Tue, Dec 12, 2017 at 07:44:27PM -0500, Sinan Kaya wrote:
> On 12/12/2017 7:09 PM, Sinan Kaya wrote:
> > On 12/12/2017 7:36 AM, Rafael J. Wysocki wrote:
> >> On Tue, Dec 12, 2017 at 6:38 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> >>> On Thu, Dec 07, 2017 at 04:10:24PM -0500, Sinan Kaya wrote:
> >>>> Introduce new ACPI and OF device ids for thw HW along with the helper
> >>>> functions.
> >>>>
> >>>> Changes from v6:
> >>>> * add const to the device callback parameter in fwnode.
> >>>> * reorganize the callbacks in the code
> >>>> * rename get_match_data() as device_get_match_data()
> >>>> * place pointer checks into acpi_get_match_data()
> >>>
> >>> This fails for me at 3rd patch. I am on -rc1 is there a dependency?
> >>
> >> There shouldn't be any.
> >>
> >> According to git, all changes to the files touched by the [3/7] are in
> >> -rc1 already.
> >>
> > 
> > Let me know if you were able to resolve the conflict. I can rebase against
> > a development tree if you can point me to there.
> > 
> 
> Apparently, my patches were based of 4.14 kernel. 
> 
> I just rebased to 4.15-rc1.
> 
> I can post a new version. Let me know.

Sure that should help