From: Thierry Reding <thierry.reding@gmail.com>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: dri-devel@lists.freedesktop.org, airlied@linux.ie,
linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org,
lee.jones@linaro.org
Subject: Re: [PATCH v3 05/16] drm: sti: add HDA driver
Date: Wed, 21 May 2014 19:24:33 +0200 [thread overview]
Message-ID: <20140521172429.GS2014@ulmo> (raw)
In-Reply-To: <1400594186-8956-6-git-send-email-benjamin.gaignard@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 2869 bytes --]
On Tue, May 20, 2014 at 03:56:15PM +0200, Benjamin Gaignard wrote:
> Add driver to support analog TV ouput.
Unfortunate that this has the same abbreviation as High-Definition
Audio...
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
[...]
> +/* Video DACs control */
> +#define VIDEO_DACS_CONTROL_MASK 0x0FFF
> +#define VIDEO_DACS_CONTROL_SYSCFG2535 0x085C /* for stih416 */
> +#define DAC_CFG_HD_OFF_SHIFT 5
> +#define DAC_CFG_HD_OFF_MASK (0x7 << DAC_CFG_HD_OFF_SHIFT)
> +#define VIDEO_DACS_CONTROL_SYSCFG5072 0x0120 /* for stih407 */
syscfg is starting to look more and more like it could be a syscon
driver or some other specialized, platform-specific driver.
> +/* Index (in supported modes table) of the preferred video mode */
> +#define HDA_PREF_MODE_IDX 0
I don't think this symbolic name is particularly useful.
> +/* Reference to the hda device */
> +struct device *hda_dev;
This shouldn't be needed.
> +static void sti_hda_configure_awg(struct sti_hda *hda, u32 *awg_instr, int nb)
> +{
> + int i;
unsigned
> +/*
> + * Get modes
> + *
> + * @drm_connector: pointer on the drm connector
> + *
> + * Return number of modes
> + */
> +static int sti_hda_get_modes(struct drm_connector *drm_connector)
> +{
> + struct drm_device *dev = drm_connector->dev;
> + struct drm_display_mode *mode;
> + int i, count;
unsigned for i. count should probably stay signed since DRM uses that
throughout.
> +
> + DRM_DEBUG_DRIVER("\n");
> +
> + for (i = 0, count = 0; i < ARRAY_SIZE(hda_supported_modes); i++) {
You can initialize count when it's declared to make the loop more
idiomatic.
> + mode = drm_mode_duplicate(dev, &hda_supported_modes[i].mode);
> + if (!mode)
> + continue;
> + mode->vrefresh = drm_mode_vrefresh(mode);
> +
> + /* Set the preferred mode */
> + if (i == HDA_PREF_MODE_IDX)
> + mode->type |= DRM_MODE_TYPE_PREFERRED;
> +
> + drm_mode_probed_add(drm_connector, mode);
> + count++;
> + }
> +
> + drm_mode_sort(&drm_connector->modes);
> +
> + return count;
> +}
> +
> +
Gratuituous newline.
> +static int sti_hda_probe(struct platform_device *pdev)
> +{
[...]
> +}
> +
> +static int sti_hda_remove(struct platform_device *pdev)
> +{
[...]
> +}
> +
> +static struct of_device_id hda_match_types[] = {
> + {
> + .compatible = "st,stih416-hda",
> + },
> + {
> + .compatible = "st,stih407-hda",
> + },
> + { /* end node */ }
> +};
> +MODULE_DEVICE_TABLE(of, hda_match_types);
> +
> +struct platform_driver sti_hda_driver = {
> + .driver = {
> + .name = "sti-hda",
> + .owner = THIS_MODULE,
> + .of_match_table = hda_match_types,
> + },
> + .probe = sti_hda_probe,
> + .remove = sti_hda_remove,
> +};
> +
> +module_platform_driver(sti_hda_driver);
> +
> +MODULE_LICENSE("GPL");
Same comments here as for all previous patches.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-21 17:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 13:56 [PATCH v3 00/16] Add DRM for stih4xx platforms Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 01/16] drm: sti: add VTG driver Benjamin Gaignard
2014-05-21 14:40 ` Thierry Reding
2014-05-21 15:32 ` Lee Jones
2014-05-20 13:56 ` [PATCH v3 02/16] drm: sti: add VTAC drivers Benjamin Gaignard
2014-05-21 15:28 ` Thierry Reding
2014-05-20 13:56 ` [PATCH v3 03/16] drm: sti: add HDMI driver Benjamin Gaignard
2014-05-21 17:08 ` Thierry Reding
2014-05-20 13:56 ` [PATCH v3 04/16] drm: sti: add I2C client driver for HDMI Benjamin Gaignard
2014-05-21 17:12 ` Thierry Reding
2014-05-20 13:56 ` [PATCH v3 05/16] drm: sti: add HDA driver Benjamin Gaignard
2014-05-21 17:24 ` Thierry Reding [this message]
2014-05-20 13:56 ` [PATCH v3 06/16] drm: sti: add TVOut driver Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 07/16] drm: sti: add sti layer interface definition Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 08/16] drm: sti: add GDP layer Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 09/16] drm: sti: add VID layer Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 10/16] drm: sti: add Mixer Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 11/16] drm: sti: add Compositor Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 12/16] drm: sti: add debug to GDP Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 13/16] drm: sti: add debug to VID Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 14/16] drm: sti: add debug to TVout Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 15/16] drm: sti: add debug to mixer Benjamin Gaignard
2014-05-20 13:56 ` [PATCH v3 16/16] drm: sti: Add DRM driver itself Benjamin Gaignard
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=20140521172429.GS2014@ulmo \
--to=thierry.reding@gmail.com \
--cc=airlied@linux.ie \
--cc=benjamin.gaignard@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee.jones@linaro.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@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