Re: [PATCH v2 0/3] r8a7793 Gose video input support

2017-05-01 Thread Simon Horman
On Fri, Apr 28, 2017 at 11:40:20AM +0300, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Friday 28 Apr 2017 07:16:24 Simon Horman wrote:
> > On Wed, Apr 26, 2017 at 06:56:06PM +0300, Laurent Pinchart wrote:
> > > On Tuesday 21 Feb 2017 01:42:15 Laurent Pinchart wrote:
> > >> On Thursday 20 Oct 2016 10:49:11 Simon Horman wrote:
> > >>> On Tue, Oct 18, 2016 at 05:02:20PM +0200, Ulrich Hecht wrote:
> >  Hi!
> >  
> >  This is a by-the-datasheet implementation of analog and digital video
> >  input on the Gose board.
> >  
> >  I have tried to address all concerns raised by reviewers, with the
> >  exception of the composite input patch, which has been left as is for
> >  now.
> >  
> >  CU
> >  Uli
> >  
> >  
> >  Changes since v1:
> >  - r8a7793.dtsi: added VIN2
> >  - modeled HDMI decoder input/output and connector
> >  - added "renesas,rcar-gen2-vin" compat strings
> >  - removed unnecessary "remote" node and aliases
> >  - set ADV7612 interrupt to GP4_2
> >  
> >  Ulrich Hecht (3):
> >    ARM: dts: r8a7793: Enable VIN0-VIN2
> > >>> 
> > >>> I have queued up the above patch with Laurent and Geert's tags.
> > >>> 
> >    ARM: dts: gose: add HDMI input
> >    ARM: dts: gose: add composite video input
> > >>> 
> > >>> Please address the review of the above two patches and repost.
> > >> 
> > >> Could you please do so ? Feedback on 2/3 should be easy to handle. For
> > >> 3/3, you might need to ping the DT maintainers.
> > > 
> > > Ping. These are the only two patches that block
> > > 
> > > VIN,v4.12,public,ulrich,Gen2 VIN integration
> > 
> > Sorry, I'm unsure how these slipped through the cracks.
> > I now have them queued up locally for v4.13 and I plan to push this morning.
> 
> Please don't, the ping was for Ulrich, he needs to address review comments on 
> patches 2/3 and 3/3.

Oh, sorry. I will dequeue them.


Re: [PATCH 0/5] RFC: ADV748x HDMI/Analog video receiver

2017-05-01 Thread Simon Horman
On Fri, Apr 28, 2017 at 09:47:05AM +0100, Kieran Bingham wrote:
> Hi Simon,
> 
> On 28/04/17 08:09, Simon Horman wrote:
> > On Thu, Apr 27, 2017 at 07:25:59PM +0100, Kieran Bingham wrote:
> >> From: Kieran Bingham 
> >>
> >> This is an RFC for the Analog Devices ADV748x driver, and follows on from a
> >> previous posting by Niklas Söderlund [0] of an earlier incarnation of this
> >> driver.
> > 
> > ...
> > 
> >> This series presents the following patches:
> >>
> >>  [PATCH 1/5] v4l2-subdev: Provide a port mapping for asynchronous
> >>  [PATCH 2/5] rcar-vin: Match sources against ports if specified.
> >>  [PATCH 3/5] media: i2c: adv748x: add adv748x driver
> >>  [PATCH 4/5] arm64: dts: r8a7795: salvator-x: enable VIN, CSI and ADV7482
> >>  [PATCH 5/5] arm64: dts: r8a7796: salvator-x: enable VIN, CSI and ADV7482
> > 
> > I am marking the above dts patches as "RFC" and do not plan to apply them
> > unless you ping me or repost them.
> 
> Yes, sorry - the whole series was supposed to be marked as RFC, but I didn't
> think about it - and apparently only applied the tag to the cover letter.
> 
> Apologies for any confusion.

It was clear enough, though an tag RFC in every patch would be better.
In any case I was referring to how I have handled these patches in
patchwork.

Apologies for any confusion.

> > Assuming they don't cause any
> > regressions I would be happy to consider applying them as soon as their
> > dependencies are accepted.
> 
> Does that mean you've done a cursory glance over the content ? :-)

Yes, I did take a quick glance.

> In this instance, the port numbers need to revert back to a zero-base,
> but I would appreciate an eye on how and where I've put the
> representation of the physical hdmi/cvbs connectors. Having modified
> plenty of DT, but not actually submitted much - I still feel 'new' at it
> - so I'm sure I may not have followed the standards quite right yet.

Assuming you are talking about where in the DT file the hdmi and cvbs nodes
should go, I think this is somewhat arbitrary so long as they are within
the top-level node - what you have looks good to me.

> The dts patches are based heavily on the previous posting by Niklas, but I 
> have
> extended to put the extra hdmi and cvbs links in.
> 
> Regards
> --
> Kieran
> 


Re: [PATCH v2 1/2] dt-bindings: clk: r7s72100: add USB bit definitions

2017-05-01 Thread Simon Horman
On Fri, Apr 28, 2017 at 12:01:33PM -0700, Chris Brandt wrote:
> Add the bit locations that correspond to the USB clocks.
> 
> Signed-off-by: Chris Brandt 
> Reviewed-by: Geert Uytterhoeven 

Thanks, I have queued up this and the following patch for v4.13.


[RFC PATCH 6/6] mmc: sdhi: add CMD23 support to R-Car Gen2 & Gen3

2017-05-01 Thread Wolfram Sang
Signed-off-by: Wolfram Sang 
---
 drivers/mmc/host/sh_mobile_sdhi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c 
b/drivers/mmc/host/sh_mobile_sdhi.c
index bc6be0dbea3927..4843ce800c918d 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -96,7 +96,7 @@ static struct sh_mobile_sdhi_scc rcar_gen2_scc_taps[] = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
  TMIO_MMC_CLK_ACTUAL | TMIO_MMC_MIN_RCAR2,
-   .capabilities   = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
+   .capabilities   = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 
MMC_CAP_CMD23,
.dma_buswidth   = DMA_SLAVE_BUSWIDTH_4_BYTES,
.dma_rx_offset  = 0x2000,
.scc_offset = 0x0300,
@@ -115,7 +115,7 @@ static struct sh_mobile_sdhi_scc rcar_gen3_scc_taps[] = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen3_compatible = {
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
  TMIO_MMC_CLK_ACTUAL | TMIO_MMC_MIN_RCAR2,
-   .capabilities   = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
+   .capabilities   = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ | 
MMC_CAP_CMD23,
.bus_shift  = 2,
.scc_offset = 0x1000,
.taps   = rcar_gen3_scc_taps,
-- 
2.11.0



[RFC PATCH 3/6] mmc: tmio: remove outdated comment

2017-05-01 Thread Wolfram Sang
The obviously wrong comment was added in 2011 with commit df3ef2d3c92c0a
("mmc: protect the tmio_mmc driver against a theoretical race") but
already obsoleted half a year later with commit b9269fdd4f61aa ("mmc:
tmio: fix recursive spinlock, don't schedule with interrupts disabled").

Signed-off-by: Wolfram Sang 
---
 drivers/mmc/host/tmio_mmc_pio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 9d86e3ac626444..36539950347fbc 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -279,7 +279,6 @@ static void tmio_mmc_reset_work(struct work_struct *work)
mmc_request_done(host->mmc, mrq);
 }
 
-/* called with host->lock held, interrupts disabled */
 static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
 {
struct mmc_request *mrq;
-- 
2.11.0



[RFC PATCH 1/6] mmc: tmio: make tmio_mmc_request function more readable

2017-05-01 Thread Wolfram Sang
This part confused me and I had to read it twice until I got it. Let's
follow the standard pattern to bail out if something is wrong and keep
in the body of the function when everything is as expected.

Signed-off-by: Wolfram Sang 
---
 drivers/mmc/host/tmio_mmc_pio.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index a2d92f10501bdd..ba1a233f97f03c 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -889,11 +889,12 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct 
mmc_request *mrq)
}
 
ret = tmio_mmc_start_command(host, mrq->cmd);
-   if (!ret) {
-   schedule_delayed_work(&host->delayed_reset_work,
- msecs_to_jiffies(CMDREQ_TIMEOUT));
-   return;
-   }
+   if (ret)
+   goto fail;
+
+   schedule_delayed_work(&host->delayed_reset_work,
+ msecs_to_jiffies(CMDREQ_TIMEOUT));
+   return;
 
 fail:
host->force_pio = false;
-- 
2.11.0



[RFC PATCH 4/6] mmc: tmio: move finish_request function further down

2017-05-01 Thread Wolfram Sang
Plain code move with no changes. Needed for refactoring. Also, looks
nicer if request and finish_request are next to each other.

Signed-off-by: Wolfram Sang 
---
 drivers/mmc/host/tmio_mmc_pio.c | 76 -
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 36539950347fbc..b3ecb2e2e344c3 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -279,44 +279,6 @@ static void tmio_mmc_reset_work(struct work_struct *work)
mmc_request_done(host->mmc, mrq);
 }
 
-static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
-{
-   struct mmc_request *mrq;
-   unsigned long flags;
-
-   spin_lock_irqsave(&host->lock, flags);
-
-   mrq = host->mrq;
-   if (IS_ERR_OR_NULL(mrq)) {
-   spin_unlock_irqrestore(&host->lock, flags);
-   return;
-   }
-
-   host->cmd = NULL;
-   host->data = NULL;
-   host->force_pio = false;
-
-   cancel_delayed_work(&host->delayed_reset_work);
-
-   host->mrq = NULL;
-   spin_unlock_irqrestore(&host->lock, flags);
-
-   if (mrq->cmd->error || (mrq->data && mrq->data->error))
-   tmio_mmc_abort_dma(host);
-
-   if (host->check_scc_error)
-   host->check_scc_error(host);
-
-   mmc_request_done(host->mmc, mrq);
-}
-
-static void tmio_mmc_done_work(struct work_struct *work)
-{
-   struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
- done);
-   tmio_mmc_finish_request(host);
-}
-
 /* These are the bitmasks the tmio chip requires to implement the MMC response
  * types. Note that R1 and R6 are the same in this scheme. */
 #define APP_CMD0x0040
@@ -908,6 +870,44 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct 
mmc_request *mrq)
tmio_process_mrq(host, mrq);
 }
 
+static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
+{
+   struct mmc_request *mrq;
+   unsigned long flags;
+
+   spin_lock_irqsave(&host->lock, flags);
+
+   mrq = host->mrq;
+   if (IS_ERR_OR_NULL(mrq)) {
+   spin_unlock_irqrestore(&host->lock, flags);
+   return;
+   }
+
+   host->cmd = NULL;
+   host->data = NULL;
+   host->force_pio = false;
+
+   cancel_delayed_work(&host->delayed_reset_work);
+
+   host->mrq = NULL;
+   spin_unlock_irqrestore(&host->lock, flags);
+
+   if (mrq->cmd->error || (mrq->data && mrq->data->error))
+   tmio_mmc_abort_dma(host);
+
+   if (host->check_scc_error)
+   host->check_scc_error(host);
+
+   mmc_request_done(host->mmc, mrq);
+}
+
+static void tmio_mmc_done_work(struct work_struct *work)
+{
+   struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
+ done);
+   tmio_mmc_finish_request(host);
+}
+
 static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
 {
if (!host->clk_enable)
-- 
2.11.0



[RFC PATCH 0/6] tmio/sdhi: add cmd23 support

2017-05-01 Thread Wolfram Sang
This series adds CMD23 support to SDHI. It was tested on H2 (Gen2, Lager) and
M3W (Gen3, Salvator-X). The test procedure can be found here:

http://elinux.org/Tests:SDHI-CMD23

Patches are based on mmc/next from today. A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
renesas/topic/sdhi-cmd23

The reason these patches are RFC is that they should not be applied right now.
We also have some heavier refactoring going on and it is likely to be better to
apply these patches after the refactoring. However, I send them out now to
encourage review and testing. They do work as expected in my tests.

Thanks and kind regards,

   Wolfram


Wolfram Sang (6):
  mmc: tmio: make tmio_mmc_request function more readable
  mmc: tmio: refactor handling mrq
  mmc: tmio: remove outdated comment
  mmc: tmio: move finish_request function further down
  mmc: tmio: add CMD23 support
  mmc: sdhi: add CMD23 support to R-Car Gen2 & Gen3

 drivers/mmc/host/sh_mobile_sdhi.c |   4 +-
 drivers/mmc/host/tmio_mmc_pio.c   | 135 ++
 2 files changed, 80 insertions(+), 59 deletions(-)

-- 
2.11.0



[RFC PATCH 5/6] mmc: tmio: add CMD23 support

2017-05-01 Thread Wolfram Sang
Signed-off-by: Wolfram Sang 
---
 drivers/mmc/host/tmio_mmc_pio.c | 41 -
 1 file changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b3ecb2e2e344c3..a81b86ca735845 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -332,11 +332,11 @@ static int tmio_mmc_start_command(struct tmio_mmc_host 
*host, struct mmc_command
c |= TRANSFER_MULTI;
 
/*
-* Disable auto CMD12 at IO_RW_EXTENDED when
-* multiple block transfer
+* Disable auto CMD12 at IO_RW_EXTENDED and 
SET_BLOCK_COUNT
+* when doing multiple block transfer
 */
if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
-   (cmd->opcode == SD_IO_RW_EXTENDED))
+   (cmd->opcode == SD_IO_RW_EXTENDED || 
host->mrq->sbc))
c |= NO_CMD12_ISSUE;
}
if (data->flags & MMC_DATA_READ)
@@ -513,7 +513,7 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host)
host->mrq);
}
 
-   if (stop) {
+   if (stop && !host->mrq->sbc) {
if (stop->opcode != MMC_STOP_TRANSMISSION || stop->arg)
dev_err(&host->pdev->dev, "unsupported stop: 
CMD%u,0x%x. We did CMD12,0\n",
stop->opcode, stop->arg);
@@ -820,15 +820,21 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, 
u32 opcode)
 
 static void tmio_process_mrq(struct tmio_mmc_host *host, struct mmc_request 
*mrq)
 {
+   struct mmc_command *cmd;
int ret;
 
-   if (mrq->data) {
-   ret = tmio_mmc_start_data(host, mrq->data);
-   if (ret)
-   goto fail;
+   if (mrq->sbc && host->cmd != mrq->sbc) {
+   cmd = mrq->sbc;
+   } else {
+   cmd = mrq->cmd;
+   if (mrq->data) {
+   ret = tmio_mmc_start_data(host, mrq->data);
+   if (ret)
+   goto fail;
+   }
}
 
-   ret = tmio_mmc_start_command(host, mrq->cmd);
+   ret = tmio_mmc_start_command(host, cmd);
if (ret)
goto fail;
 
@@ -883,13 +889,16 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host 
*host)
return;
}
 
-   host->cmd = NULL;
-   host->data = NULL;
-   host->force_pio = false;
+   /* If not SET_BLOCK_COUNT, clear old data */
+   if (host->cmd != mrq->sbc) {
+   host->cmd = NULL;
+   host->data = NULL;
+   host->force_pio = false;
+   host->mrq = NULL;
+   }
 
cancel_delayed_work(&host->delayed_reset_work);
 
-   host->mrq = NULL;
spin_unlock_irqrestore(&host->lock, flags);
 
if (mrq->cmd->error || (mrq->data && mrq->data->error))
@@ -898,6 +907,12 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host 
*host)
if (host->check_scc_error)
host->check_scc_error(host);
 
+   /* If SET_BLOCK_COUNT, continue with main command */
+   if (host->mrq) {
+   tmio_process_mrq(host, mrq);
+   return;
+   }
+
mmc_request_done(host->mmc, mrq);
 }
 
-- 
2.11.0



[RFC PATCH 2/6] mmc: tmio: refactor handling mrq

2017-05-01 Thread Wolfram Sang
Split handling mrq into a seperate function. We need to call it from
another place soon.

Signed-off-by: Wolfram Sang 
---
 drivers/mmc/host/tmio_mmc_pio.c | 46 +++--
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba1a233f97f03c..9d86e3ac626444 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -857,12 +857,36 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, 
u32 opcode)
return ret;
 }
 
+static void tmio_process_mrq(struct tmio_mmc_host *host, struct mmc_request 
*mrq)
+{
+   int ret;
+
+   if (mrq->data) {
+   ret = tmio_mmc_start_data(host, mrq->data);
+   if (ret)
+   goto fail;
+   }
+
+   ret = tmio_mmc_start_command(host, mrq->cmd);
+   if (ret)
+   goto fail;
+
+   schedule_delayed_work(&host->delayed_reset_work,
+ msecs_to_jiffies(CMDREQ_TIMEOUT));
+   return;
+
+fail:
+   host->force_pio = false;
+   host->mrq = NULL;
+   mrq->cmd->error = ret;
+   mmc_request_done(host->mmc, mrq);
+}
+
 /* Process requests from the MMC layer */
 static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
 {
struct tmio_mmc_host *host = mmc_priv(mmc);
unsigned long flags;
-   int ret;
 
spin_lock_irqsave(&host->lock, flags);
 
@@ -882,25 +906,7 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct 
mmc_request *mrq)
 
spin_unlock_irqrestore(&host->lock, flags);
 
-   if (mrq->data) {
-   ret = tmio_mmc_start_data(host, mrq->data);
-   if (ret)
-   goto fail;
-   }
-
-   ret = tmio_mmc_start_command(host, mrq->cmd);
-   if (ret)
-   goto fail;
-
-   schedule_delayed_work(&host->delayed_reset_work,
- msecs_to_jiffies(CMDREQ_TIMEOUT));
-   return;
-
-fail:
-   host->force_pio = false;
-   host->mrq = NULL;
-   mrq->cmd->error = ret;
-   mmc_request_done(mmc, mrq);
+   tmio_process_mrq(host, mrq);
 }
 
 static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
-- 
2.11.0



Re: [PATCH v2 0/5] arm64: dts: renesas: Break out common board support

2017-05-01 Thread Simon Horman
On Fri, Apr 28, 2017 at 02:58:39PM +0200, Geert Uytterhoeven wrote:
>   Hi Simon, Magnus,
> 
> The Renesas Salvator-X and ULCB development board can be equipped with
> either an R-Car H3 or M3-W SiP, which are pin-compatible.  All boards
> use separate DTBs, but currently there's no sharing of board-specific
> devices in DTS.
> 
> This series reduces duplication by extracting common board support into
> their own .dtsi files.  As the level of support varies across boards and
> SoCs, this requires the addition of a few external clocks and
> placeholder devices on R-Car M3-W, so the common board support DTS can
> refer to them.
> 
>   - Patches 1 and 2 add the external audio and PCIe bus clocks on R-Car
> M3-W, which are present in r8a7795.dtsi, and used in
> r8a7795-salvator-x.dts,
>   - Patch 3 adds placeholders for devices that are not yet supported
> and/or tested on R-Car M3-W, but used on R-Car H3,
>   - Patch 4 extracts common Salvator-X board support,
>   - Patch 5 extracts common ULCB board support.
> 
> For R-Car H3 based boards, there are no functional changes.
> For R-Car M3-W based boards, some new devices are now described in DT.
> 
> Compared to v1, the most important change is a rebase to remove the
> dependency on "[PATCH 0/8] arm64: dts: renesas: Break out R-Car H3 and
> M3-W SiP" (http://www.spinics.net/lists/devicetree/msg173820.html).
> Please refer to the individual patches for more changelog information.
> 
> Dependencies:
>   - renesas-devel-20170428-v4.11-rc8.
> 
> DTB changes have been inspected using scripts/dtc/dtx_diff.
> This has been tested on Salvator-X (both H3 and M3-W), H3ULCB, and
> M3ULCB.
> 
> Thanks for applying!

Thanks, done.


[PULL REQUEST] renesas/topic/sdhi-cmd23 for renesas drivers

2017-05-01 Thread Wolfram Sang
Hi Geert,

here is a new topic branch for renesas-drivers based on mmc/next as of
today. There are likely going to be conflicts once Simon publishes his
SDHI DMA refactor work. Please drop this branch then, I think it is best
if I will provide you with a rebased version once this happens. We will
see. But for now, please pull.

Kind regards,

   Wolfram


The following changes since commit a627f025eb0534052ff451427c16750b3530634c:

  mmc: sdhci-of-esdhc: limit SD clock for ls1012a/ls1046a (2017-04-28 14:53:13 
+0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
renesas/topic/sdhi-cmd23

for you to fetch changes up to 7e4df752d57931e2962254e18cee12890f9018ce:

  mmc: sdhi: add CMD23 support to R-Car Gen2 & Gen3 (2017-05-01 10:52:56 +0200)


Wolfram Sang (6):
  mmc: tmio: make tmio_mmc_request function more readable
  mmc: tmio: refactor handling mrq
  mmc: tmio: remove outdated comment
  mmc: tmio: move finish_request function further down
  mmc: tmio: add CMD23 support
  mmc: sdhi: add CMD23 support to R-Car Gen2 & Gen3

 drivers/mmc/host/sh_mobile_sdhi.c |   4 +-
 drivers/mmc/host/tmio_mmc_pio.c   | 135 ++
 2 files changed, 80 insertions(+), 59 deletions(-)


signature.asc
Description: PGP signature


Re: [RFC v2 1/2] media: platform: Add SH CEU camera interface driver

2017-05-01 Thread jmondi
Hi Laurent,
   thanks for the extensive review

On Thu, Apr 27, 2017 at 02:47:14PM +0300, Laurent Pinchart wrote:
> Hi Jacopo,
>
> Thank you for the patch.
>
> This is a partial review, as some of the comments will result in large changes
> that would make review of some of the current code pointless. There is however
> enough comments to keep you busy for a bit :-)
>

Indeed

> By the way, you might want to keep your development history in a private git
> branch, in order to bisect issues when you'll finally be able to test the
> driver on real hardware. Otherwise we'll end up at v7, the driver won't work,
> and you will have no idea why.
>

As many of your comments are on existing code that I blindly took from
the existing driver, I decided to start fresh with a new driver from
scratch.
Next patches I will send will be based on your comments on this
series, and I take the opportunity to ask some questions on some
parts of code that were already in the driver and I'm failing to fully
understand.

To speed things up, I'm going to reply/make questions on code as I'm
rewriting it, so let's start from the bottom of the driver.

> On Thursday 27 Apr 2017 10:42:27 Jacopo Mondi wrote:
> > Add driver for SH Mobile CEU driver, based on
> > drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> >
> > The original driver was based on soc-camera framework.
> >
> > Signed-off-by: Jacopo Mondi 
> > ---
> >  drivers/media/platform/Kconfig |9 +
> >  drivers/media/platform/Makefile|2 +
> >  drivers/media/platform/sh_ceu_camera.c | 1597 +
> >  3 files changed, 1608 insertions(+)
> >  create mode 100644 drivers/media/platform/sh_ceu_camera.c
> >
> > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> > index c9106e1..afb10fd 100644
> > --- a/drivers/media/platform/Kconfig
> > +++ b/drivers/media/platform/Kconfig
> > @@ -114,6 +114,15 @@ config VIDEO_S3C_CAMIF
> >   To compile this driver as a module, choose M here: the module
> >   will be called s3c-camif.
> >
> > +config VIDEO_SH_MOBILE_CEU
> > +   tristate "SuperH Mobile CEU Interface driver"
>
> Maybe this should be renamed to include the RZ family ?
>

I have renamed config symbol in RENESAS_CEU and transformed all
instances of "sh_ceu" in driver's code in "ceu_camera" or just "ceu"
when appropriate (eg. "ceu_device" or "ceu_buffer")

> > +   depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA && HAVE_CLK
>
> You don't use the clock API directly, I think you can drop HAVE_CLK.
>
> > +   depends on ARCH_SHMOBILE || COMPILE_TEST
> > +   depends on HAS_DMA
>
> This is already included above.
>
> > +   select VIDEOBUF2_DMA_CONTIG
> > +   ---help---
> > + This is a v4l2 driver for the SuperH Mobile CEU Interface
> > +
> >  source "drivers/media/platform/soc_camera/Kconfig"
> >  source "drivers/media/platform/exynos4-is/Kconfig"
> >  source "drivers/media/platform/am437x/Kconfig"
> > diff --git a/drivers/media/platform/Makefile
> > b/drivers/media/platform/Makefile index 349ddf6..a2b9aa6 100644
> > --- a/drivers/media/platform/Makefile
> > +++ b/drivers/media/platform/Makefile
> > @@ -25,6 +25,8 @@ obj-$(CONFIG_VIDEO_CODA)  += coda/
> >
> >  obj-$(CONFIG_VIDEO_SH_VEU) += sh_veu.o
> >
> > +obj-$(CONFIG_VIDEO_SH_MOBILE_CEU)  += sh_ceu_camera.o
> > +

This will be renamed in "ceu_camera.c" as well

> >  obj-$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE)+= m2m-deinterlace.o
> >
> >  obj-$(CONFIG_VIDEO_S3C_CAMIF)  += s3c-camif/
> > diff --git a/drivers/media/platform/sh_ceu_camera.c
> > b/drivers/media/platform/sh_ceu_camera.c new file mode 100644
> > index 000..07fe0e7
> > --- /dev/null
> > +++ b/drivers/media/platform/sh_ceu_camera.c
> > @@ -0,0 +1,1597 @@
> > +/*
> > + * V4L2 Driver for SuperH Mobile CEU interface
> > + *
> > + * Copyright (C) 2017 Jacopo Mondi 
> > + *
> > + * Based on soc-camera driver "soc_camera/sh_mobile_ceu_camera.c"
> > + *
> > + * Copyright (C) 2008 Magnus Damm
> > + *
> > + * Based on V4L2 Driver for PXA camera host - "pxa_camera.c",
> > + *
> > + * Copyright (C) 2006, Sascha Hauer, Pengutronix
> > + * Copyright (C) 2008, Guennadi Liakhovetski 
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
>
> Please sort headers alphabetically, it makes locating duplicated easier.
>

yup

> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +