[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110704125330.GI2820@legolas.emea.dhcp.ti.com>
Date: Mon, 4 Jul 2011 15:53:30 +0300
From: Felipe Balbi <balbi@...com>
To: Peter Ujfalusi <peter.ujfalusi@...com>
Cc: Liam Girdwood <lrg@...com>, Tony Lindgren <tony@...mide.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, linux-omap@...r.kernel.org,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
Misael Lopez Cruz <misael.lopez@...com>
Subject: Re: [PATCH v6 08/18] mfd: twl6040: Add initial support
hi,
On Tue, Jun 21, 2011 at 04:39:06PM +0300, Peter Ujfalusi wrote:
> +static int __devinit twl6040_probe(struct platform_device *pdev)
> +{
> + struct twl4030_audio_data *pdata = pdev->dev.platform_data;
> + struct twl6040 *twl6040;
> + struct mfd_cell *cell = NULL;
> + int ret, children = 0;
> +
> + if (!pdata) {
> + dev_err(&pdev->dev, "Platform data is missing\n");
> + return -EINVAL;
> + }
> +
> + twl6040 = kzalloc(sizeof(struct twl6040), GFP_KERNEL);
> + if (!twl6040)
> + return -ENOMEM;
> +
> + platform_set_drvdata(pdev, twl6040);
> +
> + twl6040_dev = pdev;
> + twl6040->dev = &pdev->dev;
> + twl6040->audpwron = pdata->audpwron_gpio;
> + twl6040->irq = pdata->naudint_irq;
> + twl6040->irq_base = pdata->irq_base;
> +
> + mutex_init(&twl6040->mutex);
> + mutex_init(&twl6040->io_mutex);
> + init_completion(&twl6040->ready);
> +
> + twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
> +
> + if (gpio_is_valid(twl6040->audpwron)) {
> + ret = gpio_request(twl6040->audpwron, "audpwron");
> + if (ret)
> + goto gpio1_err;
> +
> + ret = gpio_direction_output(twl6040->audpwron, 0);
> + if (ret)
> + goto gpio2_err;
> + }
> +
> + /* ERRATA: Automatic power-up is not possible in ES1.0 */
> + if (twl6040_get_rev(twl6040) == TWL6040_REV_ES1_0)
> + twl6040->audpwron = -EINVAL;
> +
> + if (twl6040->irq) {
> + /* codec interrupt */
> + ret = twl6040_irq_init(twl6040);
> + if (ret)
> + goto gpio2_err;
> +
> + ret = twl6040_request_irq(twl6040, TWL6040_IRQ_READY,
> + twl6040_naudint_handler, 0,
> + "twl6040_irq_ready", twl6040);
why don't you use the normal request_threaded_irq() ?? This is a bit of
obfuscation IMO.
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)
Powered by blists - more mailing lists