Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116011
b: refs/heads/master
c: c8ac3f8
h: refs/heads/master
i:
  116009: 4ad003c
  116007: 0f03636
v: v3
  • Loading branch information
Enrico Scholz authored and David Woodhouse committed Sep 1, 2008
1 parent f08a650 commit 8c88cbe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43035338ad772b6a4097b2ac530b75390bee87c1
refs/heads/master: c8ac3f818e1183eab8d08a41b01b6078c5df4b43
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-pxa/include/mach/pxa3xx_nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ struct pxa3xx_nand_platform_data {

struct mtd_partition *parts;
unsigned int nr_parts;

struct pxa3xx_nand_flash * const flash;
size_t num_flash;
};

extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
Expand Down
18 changes: 16 additions & 2 deletions trunk/drivers/mtd/nand/pxa3xx_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,26 @@ static int pxa3xx_nand_config_flash(struct pxa3xx_nand_info *info,
return 0;
}

static int pxa3xx_nand_detect_flash(struct pxa3xx_nand_info *info)
static int pxa3xx_nand_detect_flash(struct pxa3xx_nand_info *info,
const struct pxa3xx_nand_platform_data *pdata)
{
struct pxa3xx_nand_flash *f;
uint32_t id;
int i;

for (i = 0; i<pdata->num_flash; ++i) {
f = pdata->flash + i;

if (pxa3xx_nand_config_flash(info, f))
continue;

if (__readid(info, &id))
continue;

if (id == f->chip_id)
return 0;
}

for (i = 0; i < ARRAY_SIZE(builtin_flash_types); i++) {

f = builtin_flash_types[i];
Expand Down Expand Up @@ -1114,7 +1128,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
goto fail_free_buf;
}

ret = pxa3xx_nand_detect_flash(info);
ret = pxa3xx_nand_detect_flash(info, pdata);
if (ret) {
dev_err(&pdev->dev, "failed to detect flash\n");
ret = -ENODEV;
Expand Down

0 comments on commit 8c88cbe

Please sign in to comment.