linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	linux-media <linux-media@vger.kernel.org>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>
Subject: Re: [RFC 1/3] media: tw9910: Allow to probe from device tree
Date: Sat, 28 Aug 2021 10:58:15 -0300	[thread overview]
Message-ID: <CAOMZO5BWBB=KA8yZgaEpii+TqCb9vJbvzi712uwVwGOqU8wE5g@mail.gmail.com> (raw)
In-Reply-To: <20210827130150.909695-1-festevam@gmail.com>

On Fri, Aug 27, 2021 at 10:02 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Currently the driver only probes via platform data passed from
> board file.
>
> Allow to probe from device tree too.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> Hi,
>
> I am currently sending this series as RFC because I was
> not able to get the TW9990 to work on a imx6sx board yet.
>
> # media-ctl -p
> Media controller API version 5.14.0
>
> Media device information
> ------------------------
> driver          imx7-csi
> model           imx-media
> serial
> bus info
> hw revision     0x0
> driver version  5.14.0
>
> Device topology
> - entity 1: csi (2 pads, 2 links)
>             type V4L2 subdev subtype Unknown flags 0
>             device node name /dev/v4l-subdev0
>         pad0: Sink
>                 [fmt:UYVY8_2X8/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
>                 <- "tw9910 2-0044":0 [ENABLED,IMMUTABLE]
>         pad1: Source
>                 [fmt:UYVY8_2X8/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
>                 -> "csi capture":0 [ENABLED,IMMUTABLE]
>
> - entity 4: csi capture (1 pad, 1 link)
>             type Node subtype V4L flags 0
>             device node name /dev/video0
>         pad0: Sink
>                 <- "csi":1 [ENABLED,IMMUTABLE]
>
> - entity 10: tw9910 2-0044 (1 pad, 1 link)
>              type V4L2 subdev subtype Decoder flags 0
>              device node name /dev/v4l-subdev1
>         pad0: Source
>                 [fmt:UYVY8_2X8/640x480 field:interlaced-bt colorspace:smpte170m
>                  crop.bounds:(0,0)/640x480
>                  crop:(0,0)/640x480]
>                 -> "csi":0 [ENABLED,IMMUTABLE]
>
> I get the following error when setting up the pipeline:
>
> media-ctl -l "'tw9910 2-0044':0 -> 'csi':0[1]"
> media-ctl -l "'csi':1 -> 'csi capture':0[1]"
> media-ctl -v -V "'tw9910 2-0044':0 [fmt:UYVY8_2X8/800x480 field:any]"
>
> Opening media device /dev/media0
> Enumerating entities
> Found 3 entities
> Enumerating pads and links
> Setting up format UYVY8_2X8 800x480 on pad tw9910 2-0044/0
> Unable to set format: No such device or address (-6)
> Unable to setup formats: No such device or address (6)
>
> This -6 (ENXIO) error comes from:
>
> tw9910_set_frame() ---> tw9910_mask_set() ---> i2c_smbus_read_byte_data():
>
>
> static int tw9910_mask_set(struct i2c_client *client, u8 command,
>                            u8 mask, u8 set)
> {
>         s32 val = i2c_smbus_read_byte_data(client, command);
>
> I am able to dump TW9990 registers via i2cdetect and also via the probe
> function, so I2C access is OK.
>
> Not sure why I am getting these i2c_smbus_read_byte_data() errors.

I found the reason: the tw9910 driver was getting unpowered in the
incorrect place.
This problem was present prior to the DT conversion.

I will send a fix for it soon.

Thanks

  parent reply	other threads:[~2021-08-28 13:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 13:01 [RFC 1/3] media: tw9910: Allow to probe from device tree Fabio Estevam
2021-08-27 13:01 ` [RFC 2/3] media: tw9910: Allow the TW9990 to probe Fabio Estevam
2021-09-13  9:00   ` Jacopo Mondi
2021-08-27 13:01 ` [RFC 3/3] media: tw9910: Initialize the entity type Fabio Estevam
2021-09-13  9:06   ` Jacopo Mondi
2021-08-28 13:58 ` Fabio Estevam [this message]
2021-09-13  8:59 ` [RFC 1/3] media: tw9910: Allow to probe from device tree Jacopo Mondi
2021-09-13 12:53   ` Fabio Estevam
2021-09-13 20:03     ` Fabio Estevam
2021-09-13 22:12       ` Rui Miguel Silva
2021-09-16 20:52         ` Fabio Estevam
2021-09-16 22:05           ` Rui Miguel Silva
2021-09-17  3:28             ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOMZO5BWBB=KA8yZgaEpii+TqCb9vJbvzi712uwVwGOqU8wE5g@mail.gmail.com' \
    --to=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).