lkml.org 
[lkml]   [2015]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 01/17] scsi: ufs-qcom: add number of lanes per direction
From
2015-09-13 23:52 GMT+09:00 Yaniv Gardi <ygardi@codeaurora.org>:
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 1c37a7d..9638553 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -40,6 +40,7 @@
> #include <linux/async.h>
> #include <linux/devfreq.h>
>
> +#include <linux/of.h>
> #include "ufshcd.h"
> #include "unipro.h"
> #define UFSHCD_REQ_SENSE_SIZE 18
> @@ -87,6 +88,8 @@
> /* Interrupt aggregation default timeout, unit: 40us */
> #define INT_AGGR_DEF_TO 0x02
>
> +#define UFSHCD_DEFAULT_LANES_PER_DIRECTION 2
> +
> #define ufshcd_toggle_vreg(_dev, _vreg, _on) \
> ({ \
> int _ret; \
> @@ -5765,6 +5768,21 @@ static struct devfreq_dev_profile ufs_devfreq_profile = {
> .get_dev_status = ufshcd_devfreq_get_dev_status,
> };
>
> +static void ufshcd_init_lanes_per_dir(struct ufs_hba *hba)
> +{
> + struct device *dev = hba->dev;
> + int ret;
> +
> + ret = of_property_read_u32(dev->of_node, "lanes-per-direction",
> + &hba->lanes_per_direction);
> + if (ret) {
> + dev_dbg(hba->dev,
> + "%s: failed to read lanes-per-direction, ret=%d\n",
> + __func__, ret);
> + hba->lanes_per_direction = UFSHCD_DEFAULT_LANES_PER_DIRECTION;
> + }
> +}
> +
> /**
> * ufshcd_init - Driver initialization routine
> * @hba: per-adapter instance
> @@ -5788,6 +5806,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
> hba->mmio_base = mmio_base;
> hba->irq = irq;
>
> + ufshcd_init_lanes_per_dir(hba);
> +
> err = ufshcd_hba_init(hba);
> if (err)
> goto out_error;

Should this be called in ufshcd_pltfrm_init() and move
ufshcd_init_lanes_per_dir() to
ufshcd-pltfrm.c? Because all 'of_' stuffs are in ufshcd-pltfrm.c.


\
 
 \ /
  Last update: 2015-10-21 18:21    [W:0.863 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site