spitz.c (6ea24cf79e055f0a62a64baa8587e2254a493c7b) spitz.c (e580822775cfbfc43c60100c41a8046a35e5ae7f)
1/*
2 * Support for Sharp SL-Cxx00 Series of PDAs
3 * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi)
4 *
5 * Copyright (c) 2005 Richard Purdie
6 *
7 * Based on Sharp's 2.4 kernel patches/lubbock.c
8 *

--- 450 unchanged lines hidden (view full) ---

459static struct gpio_led spitz_gpio_leds[] = {
460 {
461 .name = "spitz:amber:charge",
462 .default_trigger = "sharpsl-charge",
463 .gpio = SPITZ_GPIO_LED_ORANGE,
464 },
465 {
466 .name = "spitz:green:hddactivity",
1/*
2 * Support for Sharp SL-Cxx00 Series of PDAs
3 * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi)
4 *
5 * Copyright (c) 2005 Richard Purdie
6 *
7 * Based on Sharp's 2.4 kernel patches/lubbock.c
8 *

--- 450 unchanged lines hidden (view full) ---

459static struct gpio_led spitz_gpio_leds[] = {
460 {
461 .name = "spitz:amber:charge",
462 .default_trigger = "sharpsl-charge",
463 .gpio = SPITZ_GPIO_LED_ORANGE,
464 },
465 {
466 .name = "spitz:green:hddactivity",
467 .default_trigger = "ide-disk",
467 .default_trigger = "disk-activity",
468 .gpio = SPITZ_GPIO_LED_GREEN,
469 },
470};
471
472static struct gpio_led_platform_data spitz_gpio_leds_info = {
473 .leds = spitz_gpio_leds,
474 .num_leds = ARRAY_SIZE(spitz_gpio_leds),
475};

--- 282 unchanged lines hidden (view full) ---

758
759static struct nand_bbt_descr spitz_nand_bbt = {
760 .options = 0,
761 .offs = 4,
762 .len = 2,
763 .pattern = scan_ff_pattern
764};
765
468 .gpio = SPITZ_GPIO_LED_GREEN,
469 },
470};
471
472static struct gpio_led_platform_data spitz_gpio_leds_info = {
473 .leds = spitz_gpio_leds,
474 .num_leds = ARRAY_SIZE(spitz_gpio_leds),
475};

--- 282 unchanged lines hidden (view full) ---

758
759static struct nand_bbt_descr spitz_nand_bbt = {
760 .options = 0,
761 .offs = 4,
762 .len = 2,
763 .pattern = scan_ff_pattern
764};
765
766static struct nand_ecclayout akita_oobinfo = {
767 .oobfree = { {0x08, 0x09} },
768 .eccbytes = 24,
769 .eccpos = {
770 0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
771 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
772 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
773 },
766static int akita_ooblayout_ecc(struct mtd_info *mtd, int section,
767 struct mtd_oob_region *oobregion)
768{
769 if (section > 12)
770 return -ERANGE;
771
772 switch (section % 3) {
773 case 0:
774 oobregion->offset = 5;
775 oobregion->length = 1;
776 break;
777
778 case 1:
779 oobregion->offset = 1;
780 oobregion->length = 3;
781 break;
782
783 case 2:
784 oobregion->offset = 6;
785 oobregion->length = 2;
786 break;
787 }
788
789 oobregion->offset += (section / 3) * 0x10;
790
791 return 0;
792}
793
794static int akita_ooblayout_free(struct mtd_info *mtd, int section,
795 struct mtd_oob_region *oobregion)
796{
797 if (section)
798 return -ERANGE;
799
800 oobregion->offset = 8;
801 oobregion->length = 9;
802
803 return 0;
804}
805
806static const struct mtd_ooblayout_ops akita_ooblayout_ops = {
807 .ecc = akita_ooblayout_ecc,
808 .free = akita_ooblayout_free,
774};
775
776static struct sharpsl_nand_platform_data spitz_nand_pdata = {
777 .badblock_pattern = &spitz_nand_bbt,
778 .partitions = spitz_nand_partitions,
779 .nr_partitions = ARRAY_SIZE(spitz_nand_partitions),
780};
781

--- 17 unchanged lines hidden (view full) ---

799
800static void __init spitz_nand_init(void)
801{
802 if (machine_is_spitz()) {
803 spitz_nand_partitions[1].size = 5 * 1024 * 1024;
804 } else if (machine_is_akita()) {
805 spitz_nand_partitions[1].size = 58 * 1024 * 1024;
806 spitz_nand_bbt.len = 1;
809};
810
811static struct sharpsl_nand_platform_data spitz_nand_pdata = {
812 .badblock_pattern = &spitz_nand_bbt,
813 .partitions = spitz_nand_partitions,
814 .nr_partitions = ARRAY_SIZE(spitz_nand_partitions),
815};
816

--- 17 unchanged lines hidden (view full) ---

834
835static void __init spitz_nand_init(void)
836{
837 if (machine_is_spitz()) {
838 spitz_nand_partitions[1].size = 5 * 1024 * 1024;
839 } else if (machine_is_akita()) {
840 spitz_nand_partitions[1].size = 58 * 1024 * 1024;
841 spitz_nand_bbt.len = 1;
807 spitz_nand_pdata.ecc_layout = &akita_oobinfo;
842 spitz_nand_pdata.ecc_layout = &akita_ooblayout_ops;
808 } else if (machine_is_borzoi()) {
809 spitz_nand_partitions[1].size = 32 * 1024 * 1024;
810 spitz_nand_bbt.len = 1;
843 } else if (machine_is_borzoi()) {
844 spitz_nand_partitions[1].size = 32 * 1024 * 1024;
845 spitz_nand_bbt.len = 1;
811 spitz_nand_pdata.ecc_layout = &akita_oobinfo;
846 spitz_nand_pdata.ecc_layout = &akita_ooblayout_ops;
812 }
813
814 platform_device_register(&spitz_nand_device);
815}
816#else
817static inline void spitz_nand_init(void) {}
818#endif
819

--- 210 unchanged lines hidden ---
847 }
848
849 platform_device_register(&spitz_nand_device);
850}
851#else
852static inline void spitz_nand_init(void) {}
853#endif
854

--- 210 unchanged lines hidden ---