mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: "Sascha Hauer" <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] misc: Add devicetree SRAM driver
Date: Wed, 29 Jan 2014 14:26:45 +0400	[thread overview]
Message-ID: <1390991205.534112995@f299.i.mail.ru> (raw)
In-Reply-To: <1390987800-18095-2-git-send-email-s.hauer@pengutronix.de>

Среда, 29 января 2014, 10:30 +01:00 от Sascha Hauer <s.hauer@pengutronix.de>:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
...
> +++ b/drivers/misc/sram.c
> @@ -0,0 +1,75 @@
> +/*
> + * drivers/misc/sram.c - generic memory mapped SRAM driver
...
> +static int sram_probe(struct device_d *dev)
> +{
> +	struct sram *sram;
> +	struct resource *res;
> +	void __iomem *base;
> +	int ret;
> +
> +	base = dev_request_mem_region(dev, 0);
> +	if (!base)
> +		return -EBUSY;
> +
> +	sram = xzalloc(sizeof(*sram));
> +
> +	sram->cdev.name = asprintf("sram%d",
> +			cdev_find_free_index("sram"));
> +
> +	res = dev_get_resource(dev, 0);
> +
> +	sram->cdev.size = (unsigned long)resource_size(res);
> +	sram->cdev.ops = &memops;
> +	sram->cdev.dev = dev;
> +
> +	ret = devfs_create(&sram->cdev);
> +	if (ret)
> +		return ret;
> +
> +	return 0;
> +}

Probably we should include clock handling in this driver to make it
compatible with kernel version of this driver.

---
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-01-29 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29  9:29 [PATCH 1/2] misc Kconfig: always ask for misc devices Sascha Hauer
2014-01-29  9:30 ` [PATCH 2/2] misc: Add devicetree SRAM driver Sascha Hauer
2014-01-29 10:26   ` Alexander Shiyan [this message]
2014-01-29 20:35     ` Sascha Hauer
2014-01-30  6:35       ` Alexander Shiyan
2014-01-30  6:47   ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-30  7:41     ` Sascha Hauer
2014-01-31  8:13       ` Jean-Christophe PLAGNIOL-VILLARD

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=1390991205.534112995@f299.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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