From: snjw23@gmail.com (Sylwester Nawrocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm: omap3evm: Add support for an MT9M032 based camera board.
Date: Sun, 18 Sep 2011 00:00:16 +0200 [thread overview]
Message-ID: <4E751870.5080605@gmail.com> (raw)
In-Reply-To: <1316252097-4213-1-git-send-email-martin@neutronstar.dyndns.org>
On 09/17/2011 11:34 AM, Martin Hostettler wrote:
> Adds board support for an MT9M032 based camera to omap3evm.
...
> +
> +static int __init camera_init(void)
> +{
> + int ret = -EINVAL;
> +
> + omap_mux_init_gpio(nCAM_VD_SEL, OMAP_PIN_OUTPUT);
> + if (gpio_request(nCAM_VD_SEL, "nCAM_VD_SEL")< 0) {
> + pr_err("omap3evm-camera: Failed to get GPIO nCAM_VD_SEL(%d)\n",
> + nCAM_VD_SEL);
> + goto err;
> + }
> + if (gpio_direction_output(nCAM_VD_SEL, 1)< 0) {
> + pr_err("omap3evm-camera: Failed to set GPIO nCAM_VD_SEL(%d) direction\n",
> + nCAM_VD_SEL);
> + goto err_vdsel;
> + }
How about replacing gpio_request + gpio_direction_output with:
gpio_request_one(nCAM_VD_SEL, GPIOF_OUT_INIT_HIGH, "nCAM_VD_SEL");
> +
> + if (gpio_request(EVM_TWL_GPIO_BASE + 2, "T2_GPIO2")< 0) {
> + pr_err("omap3evm-camera: Failed to get GPIO T2_GPIO2(%d)\n",
> + EVM_TWL_GPIO_BASE + 2);
> + goto err_vdsel;
> + }
> + if (gpio_direction_output(EVM_TWL_GPIO_BASE + 2, 0)< 0) {
> + pr_err("omap3evm-camera: Failed to set GPIO T2_GPIO2(%d) direction\n",
> + EVM_TWL_GPIO_BASE + 2);
> + goto err_2;
> + }
gpio_request_one(EVM_TWL_GPIO_BASE + 2, GPIOF_OUT_INIT_LOW, "T2_GPIO2");
> +
> + if (gpio_request(EVM_TWL_GPIO_BASE + 8, "nCAM_VD_EN")< 0) {
> + pr_err("omap3evm-camera: Failed to get GPIO nCAM_VD_EN(%d)\n",
> + EVM_TWL_GPIO_BASE + 8);
> + goto err_2;
> + }
> + if (gpio_direction_output(EVM_TWL_GPIO_BASE + 8, 0)< 0) {
> + pr_err("omap3evm-camera: Failed to set GPIO nCAM_VD_EN(%d) direction\n",
> + EVM_TWL_GPIO_BASE + 8);
> + goto err_8;
> + }
...and gpio_request_one(EVM_TWL_GPIO_BASE + 8, GPIOF_OUT_INIT_LOW, "nCAM_VD_EN") ?
> +
> + omap3evm_set_mux(MUX_CAMERA_SENSOR);
> +
> +
> + ret = omap3_init_camera(&isp_platform_data);
> + if (ret< 0)
> + goto err_8;
> + return 0;
> +
> +err_8:
> + gpio_free(EVM_TWL_GPIO_BASE + 8);
> +err_2:
> + gpio_free(EVM_TWL_GPIO_BASE + 2);
> +err_vdsel:
> + gpio_free(nCAM_VD_SEL);
> +err:
> + return ret;
> +}
> +
> +device_initcall(camera_init);
--
Regards,
Sylwester
next prev parent reply other threads:[~2011-09-17 22:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-17 9:34 [PATCH v2] arm: omap3evm: Add support for an MT9M032 based camera board Martin Hostettler
2011-09-17 20:24 ` Joe Perches
2011-09-18 20:10 ` martin at neutronstar.dyndns.org
2011-09-17 22:00 ` Sylwester Nawrocki [this message]
2011-09-17 22:08 ` Laurent Pinchart
2011-09-18 20:13 ` martin at neutronstar.dyndns.org
2011-09-18 21:58 ` Laurent Pinchart
2011-09-19 6:07 ` Hiremath, Vaibhav
2011-09-19 19:24 ` martin at neutronstar.dyndns.org
2011-09-19 19:59 ` Hiremath, Vaibhav
2011-09-19 6:10 ` martin at neutronstar.dyndns.org
2011-09-19 8:01 ` Laurent Pinchart
2011-09-19 19:17 ` Guennadi Liakhovetski
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=4E751870.5080605@gmail.com \
--to=snjw23@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).