Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(18) |
Oct
(21) |
Nov
(68) |
Dec
(130) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(12) |
Feb
(41) |
Mar
(44) |
Apr
(60) |
May
(31) |
Jun
(43) |
Jul
(45) |
Aug
(54) |
Sep
(19) |
Oct
(12) |
Nov
(14) |
Dec
(30) |
2007 |
Jan
(87) |
Feb
(41) |
Mar
(19) |
Apr
(33) |
May
(69) |
Jun
(100) |
Jul
(100) |
Aug
(86) |
Sep
(30) |
Oct
(149) |
Nov
(45) |
Dec
(59) |
2008 |
Jan
(136) |
Feb
(124) |
Mar
(67) |
Apr
(107) |
May
(168) |
Jun
(83) |
Jul
(160) |
Aug
(72) |
Sep
(166) |
Oct
(159) |
Nov
(192) |
Dec
(185) |
2009 |
Jan
(108) |
Feb
(189) |
Mar
(151) |
Apr
(219) |
May
(273) |
Jun
(297) |
Jul
(217) |
Aug
(157) |
Sep
(181) |
Oct
(146) |
Nov
(239) |
Dec
(173) |
2010 |
Jan
(175) |
Feb
(206) |
Mar
(210) |
Apr
(180) |
May
(165) |
Jun
(126) |
Jul
(150) |
Aug
(198) |
Sep
(305) |
Oct
(280) |
Nov
(279) |
Dec
(263) |
2011 |
Jan
(232) |
Feb
(182) |
Mar
(124) |
Apr
(126) |
May
(133) |
Jun
(257) |
Jul
(153) |
Aug
(134) |
Sep
(136) |
Oct
(120) |
Nov
(185) |
Dec
(132) |
2012 |
Jan
(158) |
Feb
(145) |
Mar
(257) |
Apr
(197) |
May
(253) |
Jun
(266) |
Jul
(406) |
Aug
(327) |
Sep
(334) |
Oct
(253) |
Nov
(197) |
Dec
(227) |
2013 |
Jan
(243) |
Feb
(355) |
Mar
(263) |
Apr
(256) |
May
(154) |
Jun
(291) |
Jul
(319) |
Aug
(159) |
Sep
(181) |
Oct
(212) |
Nov
(76) |
Dec
(143) |
2014 |
Jan
(322) |
Feb
(523) |
Mar
(364) |
Apr
(836) |
May
(629) |
Jun
(592) |
Jul
(579) |
Aug
(459) |
Sep
(574) |
Oct
(639) |
Nov
(470) |
Dec
(368) |
2015 |
Jan
(504) |
Feb
(554) |
Mar
(686) |
Apr
(463) |
May
(305) |
Jun
(285) |
Jul
(188) |
Aug
(151) |
Sep
(171) |
Oct
(149) |
Nov
(164) |
Dec
(164) |
2016 |
Jan
(189) |
Feb
(158) |
Mar
(154) |
Apr
(153) |
May
(187) |
Jun
(184) |
Jul
(200) |
Aug
(228) |
Sep
(252) |
Oct
(270) |
Nov
(286) |
Dec
(361) |
2017 |
Jan
(346) |
Feb
(266) |
Mar
(251) |
Apr
(132) |
May
(175) |
Jun
(161) |
Jul
(195) |
Aug
(43) |
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(2) |
2
(4) |
3
(5) |
4
(6) |
5
(5) |
6
(2) |
7
|
8
(2) |
9
(11) |
10
(37) |
11
(9) |
12
(1) |
13
(2) |
14
(1) |
15
|
16
(4) |
17
(1) |
18
(2) |
19
(4) |
20
(1) |
21
|
22
(2) |
23
(6) |
24
|
25
(4) |
26
(2) |
27
(3) |
28
(6) |
29
(6) |
30
(6) |
31
|
|
|
|
From: Ben Gamari <bgamari.foss@gm...> - 2011-08-30 13:52:35
|
--- arch/arm/mach-omap2/board-omap3beagle.c | 4 ++-- arch/arm/mach-omap2/devices.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 67999da..481c1a9 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -661,8 +661,8 @@ static struct spi_board_info beagledaq_mcspi_board_info[] = { }, }; -static int mcspi3_cs_gpios[4]; -static int mcspi4_cs_gpios[4]; +int mcspi3_cs_gpios[4]; +int mcspi4_cs_gpios[4]; static void __init beagledaq_init(void) { diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 5b8ca68..6808251 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -341,6 +341,9 @@ struct omap_device_pm_latency omap_mcspi_latency[] = { }, }; +extern int mcspi3_cs_gpios[4]; +extern int mcspi4_cs_gpios[4]; + static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) { struct omap_device *od; @@ -369,6 +372,18 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) return -EINVAL; } + /* HACK: Not enough time to figure out how to export cs_gpios from + * board file to driver correctly */ + if (spi_num == 2) { + // Setup McSPI3 cs_gpios + pdata->num_cs = 4; + pdata->cs_gpios = mcspi3_cs_gpios; + } else if (spi_num == 3) { + // Setup McSPI4 cs_gpios + pdata->num_cs = 4; + pdata->cs_gpios = mcspi4_cs_gpios; + } + spi_num++; od = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata), omap_mcspi_latency, -- 1.7.4.1 |
From: Ben Gamari <bgamari.foss@gm...> - 2011-08-30 13:51:34
|
Many applications require more chip select lines than the board or processor allow. Introduce a mechanism to allow use of GPIO pins as chip select lines with the McSPI controller. To use this tionality, one simply provides a table mapping CS line numbers to GPIO numbers omap2_mcspi_platform_config.cs_gpios. Signed-off-by: Ben Gamari <bgamari.foss@...> --- arch/arm/plat-omap/include/plat/mcspi.h | 1 + drivers/spi/omap2_mcspi.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h index 3d51b18..c5670f2 100644 --- a/arch/arm/plat-omap/include/plat/mcspi.h +++ b/arch/arm/plat-omap/include/plat/mcspi.h @@ -10,6 +10,7 @@ struct omap2_mcspi_platform_config { unsigned short num_cs; unsigned int regs_offset; + int *cs_gpios; }; struct omap2_mcspi_dev_attr { diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index f41c906..20dec5d 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -36,6 +36,7 @@ #include <linux/pm_runtime.h> #include <linux/spi/spi.h> +#include <linux/gpio.h> #include <plat/dma.h> #include <plat/clock.h> @@ -121,6 +122,7 @@ struct omap2_mcspi { /* SPI1 has 4 channels, while SPI2 has 2 */ struct omap2_mcspi_dma *dma_channels; struct device *dev; + int *cs_gpios; }; struct omap2_mcspi_cs { @@ -227,7 +229,11 @@ static void omap2_mcspi_set_enable(const struct spi_device *spi, int enable) static void omap2_mcspi_force_cs(struct spi_device *spi, int cs_active) { u32 l; + struct omap2_mcspi* mcspi = spi_master_get_devdata(spi->master); + if (mcspi->cs_gpios) + gpio_set_value(mcspi->cs_gpios[spi->chip_select], cs_active); + // TXS times out unless we force the CHCONF reg as well l = mcspi_cached_chconf0(spi); MOD_REG_BIT(l, OMAP2_MCSPI_CHCONF_FORCE, cs_active); mcspi_write_chconf0(spi, l); @@ -1088,6 +1094,8 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) struct omap2_mcspi *mcspi; struct resource *r; int status = 0, i; + struct omap2_mcspi_platform_config* pconfig = pdev->dev.platform_data; + int num_dma; master = spi_alloc_master(&pdev->dev, sizeof *mcspi); if (master == NULL) { @@ -1110,6 +1118,13 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) mcspi = spi_master_get_devdata(master); mcspi->master = master; + if (pconfig && pconfig->cs_gpios) { + mcspi->cs_gpios = pconfig->cs_gpios; + num_dma = 1; + } else { + mcspi->cs_gpios = NULL; + num_dma = master->num_chipselect; + } r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (r == NULL) { @@ -1139,14 +1154,14 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) INIT_LIST_HEAD(&mcspi->msg_queue); INIT_LIST_HEAD(&omap2_mcspi_ctx[master->bus_num - 1].cs); - mcspi->dma_channels = kcalloc(master->num_chipselect, + mcspi->dma_channels = kcalloc(num_dma, sizeof(struct omap2_mcspi_dma), GFP_KERNEL); if (mcspi->dma_channels == NULL) goto err2; - for (i = 0; i < master->num_chipselect; i++) { + for (i = 0; i < num_dma; i++) { char dma_ch_name[14]; struct resource *dma_res; -- 1.7.4.1 |
From: Ben Gamari <bgamari.foss@gm...> - 2011-08-30 13:51:22
|
Thanks for the poke. I've been meaning to send this set out again anyways. This is the patch I am currently using (on top of v3.0). Conceptually it's quite similar to the first patches I sent out but some implementation details were slightly reworked to account for the generalization of the McSPI driver to other silicon. I would say that the patch is close to mergable save the fact that there is currently no clean way to set up GPIO CS pins from a board file. I'll send the horrible hack I currently use shortly. If anyone has any ideas on how this might be done cleanly please let me know. It's sad that the mere lack of a configuration interface is the reason this isn't upstream. Cheers, - Ben |
From: Raju Sana <venkat.rajuece@gm...> - 2011-08-30 10:14:29
|
Hi Ben, Could you please post your patch as I am also working the similar design. I need to modify the existing McSPI driver to support 3 codec chips. Thanks. Venkat Raju. On Thu, Jan 28, 2010 at 9:40 AM, Ben Gamari <bgamari.foss@...> wrote: > Hey all! > > Recently I've been thinking about adding support to the McSPI driver for > using GPIO pins as chip selects. As a starting point, I've browsed the > driver source trying to identify what changes would be necessary to add > this support. It seems like the rough idea is, > > a) add a cs_gpio field to the device struct (omap2_mcspi) > b) modify omap2_mcspi_force_cs() to use cs_gpio instead of the > CHxCONF[FORCE] bit if cs_gpio is valid > > Unfortunately, I'm having a bit of difficulty seeing how the existing > configuration works. In master mode, it seems that the controller is > configured in single forced channel mode (MCSPI_MODULECTRL_SINGLE). As > far as I can tell, this means that the driver is responsible for > managing the chip selects through the MCSPI_CHxCONF[FORCE] bits. It > seems that this is ideal as little will need to be changed to > incorporate GPIO CS support. > > Nevertheless, the timing of the various operations isn't making sense to > me. As far as I understand it, the callgraph is as follows, > > > omap2_mcspi_work(): > loop over messages > omap2_mcspi_set_enable(1) > loop over transfers: > configure bus parameters > if (!cs_active) cs = 1 > if (dma): > omap2_mcspi_txrx_dma() > else: > omap2_mcspi_txrx_pio() > if (cs_change) cs = 0 > end loop > > if (cs_active) cs = 0 > omap2_mcspi_set_enable(0) > end loop > > > It seems that omap2_mcspi_set_enable() is called to enable the channel > (MCSPI_CHCTRLx[EN] is set) before force_cs() is called. If I'm > interpreting the hardware documentation correctly, the enable bit (among > other things) starts the SPI clock, meaning that the chip will begin > clocking out zeros to the device before CS is brought high. > Furthermore, even after CS is brought high, it seems there could be a > fair amount of time before the chip begins actually clocking out valid > data. > > As I am writing this, it now occurs to me that perhaps the chip doesn't > start SPI_CLK until it has data to send. It seems that if this were the > case my concerns would be resolved. However, it is not at all clear that > this is the case from the documentation. When exactly does the > controller start the bus clock? Is this stated explicitly anywhere in > the documentation? > > Any input you could offer would be greatly appreciated. > Thanks for your time. > > - Ben > > > P.S. The more and more I think about it, it seems like my hypothesis is > the only logical behavior. It would be great if someone could confirm my > suspicions, however. It really seems like this should be in the > documentation either way. > > P.P.S. I apologize if this is something someone familiar with SPI should > just know. My knowledge is a little spotty on this sort of thing. > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@... > More majordomo info at http://vger.kernel.org/majordomo-info.html > |
From: nitin vishnoi <connecting.business@ec...> - 2011-08-30 07:01:01
|
Ecademy - Exclusive business networking for the digital age _______________________________________________________________________ Join me on Ecademy http://www.ecademy.com/account.php?op=signup&xref=517814 Connect to the right people Market your business Grow revenue nitin vishnoi nitvishnoi@... _______________________________________________________________________ This email was sent to spi-devel-general@... To avoid receiving these emails in the future go to http://www.ecademy.com/blockinvites.php?e=spi-devel-general@... The Ecademy Limited. Registered in England and Wales. Company Registration:3651083 VAT:718037736 |
From: заодно <bkiwibear@co...> - 2011-08-29 21:51:29
|
Е-мэйл Рассылки Пробная рассылка - 1/3 базы - 1437 руб Москва юр.лица - 1.999844 адр - 4954 руб Москва физ.лица - 7.789454 адр - 8409 руб подробнее на сайте http://www.aaa-101.com/ |
From: Linus Walleij <linus.walleij@li...> - 2011-08-29 09:03:47
|
On Sun, Aug 28, 2011 at 9:26 PM, Peter Huewe <peterhuewe@...> wrote: > This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add > runtime PM support to core Primecell driver") which unfortunately was a little > bit incomplete and did contain a typo (11 instead of 22). > I'm not sure how this patch could have been tested back then, if it > doesn't even compile ;) > > The build failure was: > drivers/spi/spi-pl022.c:2292: error: 'adev' undeclared (first use in > this function) > drivers/spi/spi-pl022.c:2344: error: 'pl022_suspend' undeclared here > (not in a function) > > The build failure appears e.g. for the u8500 and realview defconfig. > > LinuxVersion: linux next-20110826 > > Signed-off-by: Peter Huewe <peterhuewe@...> Acked-by: Linus Walleij <linus.walleij@...> Thanks! Linus Walleij |
From: приносить <txpehqphw@vi...> - 2011-08-28 22:14:27
|
Е-мэйл Рассылки Пробная рассылка - 1/3 базы - 1486 руб Москва юр.лица - 1.986933 адр - 4939 руб Москва физ.лица - 7.776929 адр - 8424 руб подробнее на сайте http://www.aaa-101.com/ |
From: Russell King - ARM Linux <linux@ar...> - 2011-08-28 20:07:19
|
On Sun, Aug 28, 2011 at 09:26:59PM +0200, Peter Huewe wrote: > This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add > runtime PM support to core Primecell driver") which unfortunately was a little > bit incomplete and did contain a typo (11 instead of 22). > I'm not sure how this patch could have been tested back then, if it > doesn't even compile ;) Maybe it was tested on configs without CONFIG_SUSPEND enabled - which is highly likely since my ARM development boards don't support S2RAM. That's the problem with ifdef'ing code. It makes it impossible to ensure that it's properly tested. |
From: Peter Huewe <peterhuewe@gm...> - 2011-08-28 19:27:16
|
This patch fixes a build error, introduced by commit (67fc8b9f, "PM: add runtime PM support to core Primecell driver") which unfortunately was a little bit incomplete and did contain a typo (11 instead of 22). I'm not sure how this patch could have been tested back then, if it doesn't even compile ;) The build failure was: drivers/spi/spi-pl022.c:2292: error: 'adev' undeclared (first use in this function) drivers/spi/spi-pl022.c:2344: error: 'pl022_suspend' undeclared here (not in a function) The build failure appears e.g. for the u8500 and realview defconfig. LinuxVersion: linux next-20110826 Signed-off-by: Peter Huewe <peterhuewe@...> --- drivers/spi/spi-pl022.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 078338f..3520cf9 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2282,14 +2282,14 @@ pl022_remove(struct amba_device *adev) } #ifdef CONFIG_SUSPEND -static int pl011_suspend(struct device *dev) +static int pl022_suspend(struct device *dev) { struct pl022 *pl022 = dev_get_drvdata(dev); int status = 0; status = stop_queue(pl022); if (status) { - dev_warn(&adev->dev, "suspend cannot stop queue\n"); + dev_warn(dev, "suspend cannot stop queue\n"); return status; } @@ -2298,7 +2298,7 @@ static int pl011_suspend(struct device *dev) load_ssp_default_config(pl022); amba_pclk_disable(pl022->adev); amba_vcore_disable(pl022->adev); - dev_dbg(&adev->dev, "suspended\n"); + dev_dbg(dev, "suspended\n"); return 0; } -- 1.7.3.4 |
From: Stanimir Varbanov <svarbanov@mm...> - 2011-08-28 10:29:27
|
Hi, Baruch Thanks for the comments ! Baruch Siach wrote: > Hi Stanimir, > > On Thu, Aug 25, 2011 at 04:29:12PM +0300, Stanimir Varbanov wrote: >> On some devices the flash chip could be powered off when m25p driver >> is probed. To avoid erroneous detection the power of the chip must be >> turn on, add a power function in m25p_probe to switch on the power by >> platform data. The power will be turned off at the probe end. > > [snip] > >> + /* power on device while probing */ >> + m25p_power(data, 1); > > [snip] > >> +out: >> + m25p_power(data, 0); > > Shouldn't you power off in m25p_remove() as well? > IMO, no, because m25p_power(off) is called from m25p_put_device(). Then m25p_put_device() is called from mtdchar::mtd_close(). m25p_remove must fail if user didn't close mtdchar /dev/mtdX device. The motivation to use power on/off in m25p_probe is because the flash chip might be not powered when driver probe is called. The chip is powered on on the probe begging and powered off after JEDEC probe pass. > baruch > regards, Stan |
From: Baruch Siach <baruch@tk...> - 2011-08-28 06:30:19
|
Hi Stanimir, On Thu, Aug 25, 2011 at 04:29:12PM +0300, Stanimir Varbanov wrote: > On some devices the flash chip could be powered off when m25p driver > is probed. To avoid erroneous detection the power of the chip must be > turn on, add a power function in m25p_probe to switch on the power by > platform data. The power will be turned off at the probe end. [snip] > + /* power on device while probing */ > + m25p_power(data, 1); [snip] > +out: > + m25p_power(data, 0); Shouldn't you power off in m25p_remove() as well? baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@... - tel: +972.2.679.5364, http://www.tkos.co.il - |
From: Jerry Burke<jerry.burke@vg...> - 2011-08-27 02:36:25
|
Mobile Payment 2011 Report: Operator Strategies, Opportunities and Challenges |
From: Xu, Chao <chao.xu@in...> - 2011-08-27 01:16:30
|
There are two bugs in driver/spi/spic. (1) when spi master is deconstructed, it's parent device node's reference count is not decreased. It exists from kernel 2.6.28 to 3.0. It sometimes results in memory leak. Example, its's parent device node will be always reference by others and never be released. (2) when spi device is created, its parent device node should be spi master. It should be keep consistent with function spi_unregister_master. it exists in 2.6.39 and 3.0 B. R. Chao Xu Digital Home Group Intel Corporation Tel: 86-21-6116-7386 Inet: 8821-7386 -----Original Message----- From: bugzilla-daemon@... [mailto:bugzilla-daemon@...] Sent: Saturday, August 27, 2011 7:20 AM To: Xu, Chao Subject: [Bug 40302] spi master's parent device node 's reference count is not decreased https://bugzilla.kernel.org/show_bug.cgi?id=40302 Andrew Morton <akpm@...> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |akpm@... --- Comment #1 from Andrew Morton <akpm@...> 2011-08-26 23:20:17 --- Please don't send patches via bugzilla - it causes lots of problems with our usual patch management and review processes. Please send this patch via email as per Documentation/SubmittingPatches. Suitable recipients may be found via scripts/get_maintainer.pl. Please also cc myself on the email. Thanks. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. You reported the bug. |
From: yklhdr Moderator <yklhdr-owner@ya...> - 2011-08-26 08:49:42
|
Hello, I've added you to my yklhdr group at Yahoo! Groups, a free, easy-to-use service. Yahoo! Groups makes it easy to send and receive group messages, coordinate events, share photos and files, and more. Description of the group: ------------------------------------------------------------------------ oc8k5et7or7807 Complete your Yahoo! Groups account: ---------------------------------------------------------------------- Your email address has been added to the email list of a Yahoo! Group. To gain access to all of your group's web features (previous messages, photos, files, calendar, etc.) and easier control of your message delivery options, we highly recommend that you complete your account by connecting your email address to a Yahoo account. It is easy and free. Please visit: http://groups.yahoo.com/convacct?email=spi-devel-general%40lists.sourceforge.net&list=yklhdr Important information about the yklhdr group ------------------------------------------------------------------------ * To send a message to the members of this group, send an email to: yklhdr@... * To leave the group, you can unsubscribe by replying to this message, or by sending an email to: yklhdr-unsubscribe@... Regards, Moderator, yklhdr Report abuse: ------------------------------------------------------------------------ Because Yahoo! Groups values your privacy, it is a violation of our service rules for moderators to add subscribers to a group against their wishes. If you feel this has happened, please notify us: http://help.yahoo.com/l/us/yahoo/groups/original/members/forms/abuse.html You may also change your email preferences to prevent group owners from adding you to their groups. To do so, please go here: http://groups.yahoo.com/s?tag=ORmhGAT-t6m_-SZSb2PqCXWgvG8_Ov-q-nY0DkV-EbMuzWx7ZuTFgcCCHNhrNVdJRJ_UVNFFbGQoBrAe3sIP73FcmM31iNoBBQMXGQQ4qZg Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
From: nitin vishnoi <connecting.business@ec...> - 2011-08-26 04:22:27
|
Ecademy - Exclusive business networking for the digital age _______________________________________________________________________ Join me on Ecademy http://www.ecademy.com/account.php?op=signup&xref=517814 Connect to the right people Market your business Grow revenue nitin vishnoi nitvishnoi@... _______________________________________________________________________ This email was sent to spi-devel-general@... To avoid receiving these emails in the future go to http://www.ecademy.com/blockinvites.php?e=spi-devel-general@... The Ecademy Limited. Registered in England and Wales. Company Registration:3651083 VAT:718037736 |
From: zfxyz <bjhhjmq@so...> - 2011-08-25 19:20:52
|
From: Stanimir Varbanov <svarbanov@mm...> - 2011-08-25 13:48:42
|
On some devices the flash chip could be powered off when m25p driver is probed. To avoid erroneous detection the power of the chip must be turn on, add a power function in m25p_probe to switch on the power by platform data. The power will be turned off at the probe end. Also implement a get/put_device callbacks to power on/off the flash chip. Signed-off-by: Stanimir Varbanov <svarbanov@...> --- drivers/mtd/devices/m25p80.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index e6ba034..6ab5896 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -806,6 +806,27 @@ static const struct spi_device_id *__devinit jedec_probe(struct spi_device *spi) return ERR_PTR(-ENODEV); } +static void m25p_power(struct flash_platform_data *pdata, int on) +{ + if (pdata && pdata->power) + pdata->power(on); +} + +static int m25p_get_device(struct mtd_info *mtd) +{ + struct flash_platform_data *pdata = mtd->dev.parent->platform_data; + + m25p_power(pdata, 1); + + return 0; +} + +static void m25p_put_device(struct mtd_info *mtd) +{ + struct flash_platform_data *pdata = mtd->dev.parent->platform_data; + + m25p_power(pdata, 0); +} /* * board specific setup should have ensured the SPI clock used here @@ -820,6 +841,7 @@ static int __devinit m25p_probe(struct spi_device *spi) struct flash_info *info; unsigned i; struct mtd_part_parser_data ppdata; + int ret; /* Platform data helps sort out which chip type we have, as * well as how this board partitions it. If we don't have @@ -845,12 +867,16 @@ static int __devinit m25p_probe(struct spi_device *spi) info = (void *)id->driver_data; + /* power on device while probing */ + m25p_power(data, 1); + if (info->jedec_id) { const struct spi_device_id *jid; jid = jedec_probe(spi); if (IS_ERR(jid)) { - return PTR_ERR(jid); + ret = PTR_ERR(jid); + goto out; } else if (jid != id) { /* * JEDEC knows better, so overwrite platform ID. We @@ -867,12 +893,15 @@ static int __devinit m25p_probe(struct spi_device *spi) } flash = kzalloc(sizeof *flash, GFP_KERNEL); - if (!flash) - return -ENOMEM; + if (!flash) { + ret = -ENOMEM; + goto out; + } flash->command = kmalloc(MAX_CMD_SIZE + FAST_READ_DUMMY_BYTE, GFP_KERNEL); if (!flash->command) { kfree(flash); - return -ENOMEM; + ret = -ENOMEM; + goto out; } flash->spi = spi; @@ -902,6 +931,8 @@ static int __devinit m25p_probe(struct spi_device *spi) flash->mtd.size = info->sector_size * info->n_sectors; flash->mtd.erase = m25p80_erase; flash->mtd.read = m25p80_read; + flash->mtd.get_device = m25p_get_device; + flash->mtd.put_device = m25p_put_device; /* sst flash chips use AAI word program */ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) @@ -956,6 +987,8 @@ static int __devinit m25p_probe(struct spi_device *spi) flash->mtd.eraseregions[i].erasesize / 1024, flash->mtd.eraseregions[i].numblocks); +out: + m25p_power(data, 0); /* partitions should match sector boundaries; and it may be good to * use readonly partitions for writeprotected sectors (BP2..BP0). -- 1.7.4.1 |
From: Stanimir Varbanov <svarbanov@mm...> - 2011-08-25 13:48:42
|
Hi, Here are two patches that add a power method in flash platform data for chips power control. The first patch adding this function and the second use it in m25p driver. Comments are welcome ! Stanimir Varbanov (2): spi: flash: Add power method into flash platform data mtd: m25p80: Call a platform power method in the driver drivers/mtd/devices/m25p80.c | 41 +++++++++++++++++++++++++++++++++++++---- include/linux/spi/flash.h | 4 ++++ 2 files changed, 41 insertions(+), 4 deletions(-) -- 1.7.4.1 |
From: Stanimir Varbanov <svarbanov@mm...> - 2011-08-25 13:48:42
|
For embedded devices or devices sensible to the power consumption is reasonable to have a way to control the flash chips power. This change in flash_platform_data makes possible to control the power supply of the flash memory chip by adding a "power" method to it. The platform then could attach a callback and control power supply by it's choice. For example by other regulator driver, GPIO or do nothing. Signed-off-by: Stanimir Varbanov <svarbanov@...> --- include/linux/spi/flash.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/flash.h b/include/linux/spi/flash.h index 3f22932..045a6fc 100644 --- a/include/linux/spi/flash.h +++ b/include/linux/spi/flash.h @@ -10,6 +10,7 @@ struct mtd_partition; * @nr_parts: number of mtd_partitions for static partitoning * @type: optional flash device type (e.g. m25p80 vs m25p64), for use * with chips that can't be queried for JEDEC or other IDs + * @power: method called to enable or disable Vcc * * Board init code (in arch/.../mach-xxx/board-yyy.c files) can * provide information about SPI flash parts (such as DataFlash) to @@ -26,6 +27,9 @@ struct flash_platform_data { char *type; /* we'll likely add more ... use JEDEC IDs, etc */ + + /* on = 0 disable Vcc, on != 0 enable Vcc */ + void (*power)(int on); }; #endif -- 1.7.4.1 |
From: превратить <mlcel@co...> - 2011-08-23 23:52:49
|
Е-мэйл Рассылки Пробная рассылка - 1/3 базы - 1472 руб Москва юр.лица - 1.938026 адр - 4946 руб Москва физ.лица - 7.736040 адр - 8443 руб подробнее на сайте http://www.aaa-101.com/i2.html |
From: Jiri Slaby <jirislaby@gm...> - 2011-08-23 08:49:50
|
On 08/23/2011 09:59 AM, Jiri Slaby wrote: > When spi_fsl_espi is chosen to be built as a module, there is a build > error because we test only CONFIG_SPI_FSL_ESPI in declaration of > struct mpc8xxx_spi in drivers/spi/spi_fsl_lib.h. > > We need to add a test for CONFIG_SPI_FSL_ESPI_MODULE too. > > The error looks like: > drivers/spi/spi_fsl_espi.c: In function 'fsl_espi_bufs': > drivers/spi/spi_fsl_espi.c:232: error: 'struct mpc8xxx_spi' has no member named 'len' > ... > > Signed-off-by: Jiri Slaby <jslaby@...> > --- > drivers/spi/spi-fsl-lib.h | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h > index cbe881b..97968de 100644 > --- a/drivers/spi/spi-fsl-lib.h > +++ b/drivers/spi/spi-fsl-lib.h > @@ -28,7 +28,7 @@ struct mpc8xxx_spi { > /* rx & tx bufs from the spi_transfer */ > const void *tx; > void *rx; > -#ifdef CONFIG_SPI_FSL_ESPI > +#if defined(CONFIG_SPI_FSL_ESPI) || defined(CONFIG_SPI_FSL_ESPI_MODULE) > int len; > #endif Oh, and there are still link errors: ERROR: "mpc8xxx_spi_tx_buf_u32" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_rx_buf_u32" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_tx_buf_u16" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_rx_buf_u16" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_tx_buf_u8" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_rx_buf_u8" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "of_mpc8xxx_spi_probe" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_strmode" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_probe" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_remove" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "to_of_pinfo" [drivers/spi/spi_fsl_spi.ko] undefined! ERROR: "mpc8xxx_spi_tx_buf_u32" [drivers/spi/spi_fsl_espi.ko] undefined! ERROR: "mpc8xxx_spi_rx_buf_u32" [drivers/spi/spi_fsl_espi.ko] undefined! ERROR: "of_mpc8xxx_spi_probe" [drivers/spi/spi_fsl_espi.ko] undefined! ERROR: "mpc8xxx_spi_probe" [drivers/spi/spi_fsl_espi.ko] undefined! ERROR: "mpc8xxx_spi_remove" [drivers/spi/spi_fsl_espi.ko] undefined! The functions are not exported... Should I export all those or deny CONFIG_SPI_FSL_ESPI=m? thanks, -- js |
From: Roman Lapin <lampus.lapin@gm...> - 2011-08-23 08:30:06
|
Hello. I am newbie in kernel development. I want to realize chip select decoding function for AT91. And I'm finding the simplest method for it. I have some questions: 1. Why sizes of variables u8 spi_device.mode, u16 spi_master.mode_bits and u32 bad_bits in spi_setup() are different? I've wanted to use variable spi_device.mode for saving cs_dec flag, but I couldn't do it, because spi_device.mode is fully used for other flags. 2. I want to use spi_device.controller_data to pass pointer to GPIO array used for CS pins. If cs_dec flag is set, so I can interpret pointer in spi_device.controller_data as pointer to array of CS pins GPIO, in either case it will be interpreted as one CS pin GPIO. Is it right way? Sorry for my bad english. |
From: Sonic Zhang <sonic.adi@gm...> - 2011-08-23 08:16:57
|
Hi Grant, Any comments? Sonic Zhang On Fri, Aug 12, 2011 at 10:48 AM, Sonic Zhang <sonic.adi@...> wrote: > From: Sonic Zhang <sonic.zhang@...> > > Poll the FIFO till it is empty before deassert SSEL in pump_transfers in > soft irq mode. No polling is necessary in interrupt mode and error handling. > > Signed-off-by: Sonic Zhang <sonic.zhang@...> > --- > drivers/spi/spi-bfin5xx.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c > index b8d25f2..7e03e7d 100644 > --- a/drivers/spi/spi-bfin5xx.c > +++ b/drivers/spi/spi-bfin5xx.c > @@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data) > if (message->state == DONE_STATE) { > dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n"); > message->status = 0; > + bfin_spi_flush(drv_data); > bfin_spi_giveback(drv_data); > return; > } > @@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data) > message->actual_length += drv_data->len_in_bytes; > /* Move to next transfer of this msg */ > message->state = bfin_spi_next_transfer(drv_data); > - if (drv_data->cs_change) > + if (drv_data->cs_change) { > + bfin_spi_flush(drv_data); > bfin_spi_cs_deactive(drv_data, chip); > + } > } > > /* Schedule next transfer tasklet */ > -- > 1.7.0.4 > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@... > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > |
From: Jiri Slaby <jslaby@su...> - 2011-08-23 08:12:35
|
When spi_fsl_espi is chosen to be built as a module, there is a build error because we test only CONFIG_SPI_FSL_ESPI in declaration of struct mpc8xxx_spi in drivers/spi/spi_fsl_lib.h. We need to add a test for CONFIG_SPI_FSL_ESPI_MODULE too. The error looks like: drivers/spi/spi_fsl_espi.c: In function 'fsl_espi_bufs': drivers/spi/spi_fsl_espi.c:232: error: 'struct mpc8xxx_spi' has no member named 'len' ... Signed-off-by: Jiri Slaby <jslaby@...> --- drivers/spi/spi-fsl-lib.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h index cbe881b..97968de 100644 --- a/drivers/spi/spi-fsl-lib.h +++ b/drivers/spi/spi-fsl-lib.h @@ -28,7 +28,7 @@ struct mpc8xxx_spi { /* rx & tx bufs from the spi_transfer */ const void *tx; void *rx; -#ifdef CONFIG_SPI_FSL_ESPI +#if defined(CONFIG_SPI_FSL_ESPI) || defined(CONFIG_SPI_FSL_ESPI_MODULE) int len; #endif -- 1.7.6 |