/* * Control the power state of the IrDA transmitter. * State: * 0 - off * 1 - short range, lowest power * 2 - medium range, medium power * 3 - maximum range, high power * * Currently, only assabet is known to support this. */ static int __sa1100_irda_set_power(struct sa1100_irda *si, unsigned int state) { int ret = 0; if (machine_is_assabet()) ret = sa1100_irda_set_power_assabet(si, state); if (machine_is_h3xxx()) ret = sa1100_irda_set_power_h3600(si, state); if (machine_is_yopy()) ret = sa1100_irda_set_power_yopy(si, state); return ret; }
static int __init h3600_init_model_ops(void) { if (machine_is_h3xxx()) { if (machine_is_h3100()) { ipaq_model_ops = h3100_model_ops; } else if (machine_is_h3600()) { ipaq_model_ops = h3600_model_ops; } else if (machine_is_h3800()) { ipaq_model_ops = h3800_model_ops; } init_h3600_egpio(); } return 0; }
static int __init h3600_uda1341_init(void) { int ret; if (!machine_is_h3xxx()) return -ENODEV; ret = l3_attach_client(&uda1341, "l3-bit-sa1100-gpio", "uda1341"); if (ret) goto out; /* register devices */ audio_dev_id = register_sound_dsp(&h3600_audio_fops, -1); mixer_dev_id = register_sound_mixer(&h3600_mixer_fops, -1); printk( KERN_INFO "iPAQ audio support initialized\n" ); return 0; release_l3: l3_detach_client(&uda1341); out: return ret; }
/* * Set the IrDA communications speed. */ static int sa1100_irda_set_speed(struct sa1100_irda *si, int speed) { unsigned long flags; int brd, ret = -EINVAL; switch (speed) { case 9600: case 19200: case 38400: case 57600: case 115200: brd = 3686400 / (16 * speed) - 1; /* * Stop the receive DMA. */ if (IS_FIR(si)) sa1100_stop_dma(si->rxdma); local_irq_save(flags); Ser2UTCR3 = 0; Ser2HSCR0 = HSCR0_UART; Ser2UTCR1 = brd >> 8; Ser2UTCR2 = brd; /* * Clear status register */ Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID; Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE; if (machine_is_assabet()) ASSABET_BCR_clear(ASSABET_BCR_IRDA_FSEL); if (machine_is_h3xxx()) clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL); if (machine_is_yopy()) PPSR &= ~GPIO_IRDA_FIR; si->speed = speed; local_irq_restore(flags); ret = 0; break; case 4000000: local_irq_save(flags); si->hscr0 = 0; Ser2HSSR0 = 0xff; Ser2HSCR0 = si->hscr0 | HSCR0_HSSP; Ser2UTCR3 = 0; si->speed = speed; if (machine_is_assabet()) ASSABET_BCR_set(ASSABET_BCR_IRDA_FSEL); if (machine_is_h3xxx()) set_h3600_egpio(IPAQ_EGPIO_IR_FSEL); if (machine_is_yopy()) PPSR |= GPIO_IRDA_FIR; sa1100_irda_rx_alloc(si); sa1100_irda_rx_dma_start(si); local_irq_restore(flags); break; default: break; } return ret; }
/* sa1100_pcmcia_driver_init() * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ * * This routine performs a basic sanity check to ensure that this * kernel has been built with the appropriate board-specific low-level * PCMCIA support, performs low-level PCMCIA initialization, registers * this socket driver with Card Services, and then spawns the daemon * thread which is the real workhorse of the socket driver. * * Please see linux/Documentation/arm/SA1100/PCMCIA for more information * on the low-level kernel interface. * * Returns: 0 on success, -1 on error */ static int __init sa1100_pcmcia_driver_init(void){ servinfo_t info; struct pcmcia_init pcmcia_init; struct pcmcia_state state[SA1100_PCMCIA_MAX_SOCK]; struct pcmcia_state_array state_array; unsigned int i, clock; unsigned long mecr; printk(KERN_INFO "SA-1100 PCMCIA (CS release %s)\n", CS_RELEASE); CardServices(GetCardServicesInfo, &info); if(info.Revision!=CS_RELEASE_CODE){ printk(KERN_ERR "Card Services release codes do not match\n"); return -1; } if(machine_is_assabet()){ #ifdef CONFIG_SA1100_ASSABET if(machine_has_neponset()){ #ifdef CONFIG_ASSABET_NEPONSET pcmcia_low_level=&neponset_pcmcia_ops; #else printk(KERN_ERR "Card Services disabled: missing Neponset support\n"); return -1; #endif }else{ pcmcia_low_level=&assabet_pcmcia_ops; } #endif } else if (machine_is_freebird()) { #ifdef CONFIG_SA1100_FREEBIRD pcmcia_low_level = &freebird_pcmcia_ops; #endif } else if (machine_is_h3xxx()) { #ifdef CONFIG_SA1100_H3XXX pcmcia_low_level = &h3600_pcmcia_ops; #endif } else if (machine_is_cerf()) { #ifdef CONFIG_SA1100_CERF pcmcia_low_level = &cerf_pcmcia_ops; #endif } else if (machine_is_graphicsclient()) { #ifdef CONFIG_SA1100_GRAPHICSCLIENT pcmcia_low_level = &gcplus_pcmcia_ops; #endif } else if (machine_is_xp860()) { #ifdef CONFIG_SA1100_XP860 pcmcia_low_level = &xp860_pcmcia_ops; #endif } else if (machine_is_yopy()) { #ifdef CONFIG_SA1100_YOPY pcmcia_low_level = &yopy_pcmcia_ops; #endif } else if (machine_is_shannon()) { #ifdef CONFIG_SA1100_SHANNON pcmcia_low_level = &shannon_pcmcia_ops; #endif } else if (machine_is_pangolin()) { #ifdef CONFIG_SA1100_PANGOLIN pcmcia_low_level = &pangolin_pcmcia_ops; #endif } else if (machine_is_jornada720()) { #ifdef CONFIG_SA1100_JORNADA720 pcmcia_low_level = &jornada720_pcmcia_ops; #endif } else if(machine_is_pfs168()){ #ifdef CONFIG_SA1100_PFS168 pcmcia_low_level=&pfs168_pcmcia_ops; #endif } else if(machine_is_flexanet()){ #ifdef CONFIG_SA1100_FLEXANET pcmcia_low_level=&flexanet_pcmcia_ops; #endif } else if(machine_is_simpad()){ #ifdef CONFIG_SA1100_SIMPAD pcmcia_low_level=&simpad_pcmcia_ops; #endif } else if(machine_is_graphicsmaster()) { #ifdef CONFIG_SA1100_GRAPHICSMASTER pcmcia_low_level=&graphicsmaster_pcmcia_ops; #endif } else if(machine_is_adsbitsy()) { #ifdef CONFIG_SA1100_ADSBITSY pcmcia_low_level=&adsbitsy_pcmcia_ops; #endif } else if(machine_is_stork()) { #ifdef CONFIG_SA1100_STORK pcmcia_low_level=&stork_pcmcia_ops; #endif } if (!pcmcia_low_level) { printk(KERN_ERR "This hardware is not supported by the SA1100 Card Service driver\n"); return -ENODEV; } pcmcia_init.handler=sa1100_pcmcia_interrupt; if((sa1100_pcmcia_socket_count=pcmcia_low_level->init(&pcmcia_init))<0){ printk(KERN_ERR "Unable to initialize kernel PCMCIA service.\n"); return -EIO; } state_array.size=sa1100_pcmcia_socket_count; state_array.state=state; if(pcmcia_low_level->socket_state(&state_array)<0){ printk(KERN_ERR "Unable to get PCMCIA status from kernel.\n"); return -EIO; } /* We initialize the MECR to default values here, because we are * not guaranteed to see a SetIOMap operation at runtime. */ mecr=0; clock = cpufreq_get(0); for(i=0; i<sa1100_pcmcia_socket_count; ++i){ sa1100_pcmcia_socket[i].k_state=state[i]; /* This is an interim fix. Apparently, SetSocket is no longer * called to initialize each socket (prior to the first detect * event). For now, we'll just manually set up the mask. */ sa1100_pcmcia_socket[i].cs_state.csc_mask=SS_DETECT; sa1100_pcmcia_socket[i].virt_io=(i==0)?PCMCIA_IO_0_BASE:PCMCIA_IO_1_BASE; sa1100_pcmcia_socket[i].phys_attr=_PCMCIAAttr(i); sa1100_pcmcia_socket[i].phys_mem=_PCMCIAMem(i); MECR_FAST_SET(mecr, i, 0); MECR_BSIO_SET(mecr, i, sa1100_pcmcia_mecr_bs(SA1100_PCMCIA_IO_ACCESS, clock)); MECR_BSA_SET(mecr, i, sa1100_pcmcia_mecr_bs(SA1100_PCMCIA_5V_MEM_ACCESS, clock)); MECR_BSM_SET(mecr, i, sa1100_pcmcia_mecr_bs(SA1100_PCMCIA_5V_MEM_ACCESS, clock)); sa1100_pcmcia_socket[i].speed_io=SA1100_PCMCIA_IO_ACCESS; sa1100_pcmcia_socket[i].speed_attr=SA1100_PCMCIA_5V_MEM_ACCESS; sa1100_pcmcia_socket[i].speed_mem=SA1100_PCMCIA_5V_MEM_ACCESS; } MECR=mecr; #ifdef CONFIG_CPU_FREQ if(cpufreq_register_notifier(&sa1100_pcmcia_notifier_block) < 0){ printk(KERN_ERR "Unable to register CPU frequency change notifier\n"); return -ENXIO; } #endif /* Only advertise as many sockets as we can detect: */ if(register_ss_entry(sa1100_pcmcia_socket_count, &sa1100_pcmcia_operations)<0){ printk(KERN_ERR "Unable to register socket service routine\n"); return -ENXIO; } /* Start the event poll timer. It will reschedule by itself afterwards. */ sa1100_pcmcia_poll_event(0); DEBUG(1, "sa1100: initialization complete\n"); return 0; } /* sa1100_pcmcia_driver_init() */
static int __init sa1100_static_partitions(struct mtd_partition **parts) { int nb_parts = 0; #ifdef CONFIG_SA1100_ADSBITSY if (machine_is_adsbitsy()) { *parts = adsbitsy_partitions; nb_parts = ARRAY_SIZE(adsbitsy_partitions); } #endif #ifdef CONFIG_SA1100_ASSABET if (machine_is_assabet()) { *parts = assabet_partitions; nb_parts = ARRAY_SIZE(assabet_partitions); } #endif #ifdef CONFIG_SA1100_BADGE4 if (machine_is_badge4()) { *parts = badge4_partitions; nb_parts = ARRAY_SIZE(badge4_partitions); } #endif #ifdef CONFIG_SA1100_CERF if (machine_is_cerf()) { *parts = cerf_partitions; nb_parts = ARRAY_SIZE(cerf_partitions); } #endif #ifdef CONFIG_SA1100_CONSUS if (machine_is_consus()) { *parts = consus_partitions; nb_parts = ARRAY_SIZE(consus_partitions); } #endif #ifdef CONFIG_SA1100_FLEXANET if (machine_is_flexanet()) { *parts = flexanet_partitions; nb_parts = ARRAY_SIZE(flexanet_partitions); } #endif #ifdef CONFIG_SA1100_FREEBIRD if (machine_is_freebird()) { *parts = freebird_partitions; nb_parts = ARRAY_SIZE(freebird_partitions); } #endif #ifdef CONFIG_SA1100_FRODO if (machine_is_frodo()) { *parts = frodo_partitions; nb_parts = ARRAY_SIZE(frodo_partitions); } #endif #ifdef CONFIG_SA1100_GRAPHICSCLIENT if (machine_is_graphicsclient()) { *parts = graphicsclient_partitions; nb_parts = ARRAY_SIZE(graphicsclient_partitions); } #endif #ifdef CONFIG_SA1100_GRAPHICSMASTER if (machine_is_graphicsmaster()) { *parts = graphicsmaster_partitions; nb_parts = ARRAY_SIZE(graphicsmaster_partitions); } #endif #ifdef CONFIG_SA1100_H3XXX if (machine_is_h3xxx()) { *parts = h3xxx_partitions; nb_parts = ARRAY_SIZE(h3xxx_partitions); } #endif #ifdef CONFIG_SA1100_HACKKIT if (machine_is_hackkit()) { *parts = hackkit_partitions; nb_parts = ARRAY_SIZE(hackkit_partitions); } #endif #ifdef CONFIG_SA1100_HUW_WEBPANEL if (machine_is_huw_webpanel()) { *parts = huw_webpanel_partitions; nb_parts = ARRAY_SIZE(huw_webpanel_partitions); } #endif #ifdef CONFIG_SA1100_JORNADA720 if (machine_is_jornada720()) { *parts = jornada720_partitions; nb_parts = ARRAY_SIZE(jornada720_partitions); } #endif #ifdef CONFIG_SA1100_PANGOLIN if (machine_is_pangolin()) { *parts = pangolin_partitions; nb_parts = ARRAY_SIZE(pangolin_partitions); } #endif #ifdef CONFIG_SA1100_PT_SYSTEM3 if (machine_is_pt_system3()) { *parts = system3_partitions; nb_parts = ARRAY_SIZE(system3_partitions); } #endif #ifdef CONFIG_SA1100_SHANNON if (machine_is_shannon()) { *parts = shannon_partitions; nb_parts = ARRAY_SIZE(shannon_partitions); } #endif #ifdef CONFIG_SA1100_SHERMAN if (machine_is_sherman()) { *parts = sherman_partitions; nb_parts = ARRAY_SIZE(sherman_partitions); } #endif #ifdef CONFIG_SA1100_SIMPAD if (machine_is_simpad()) { *parts = simpad_partitions; nb_parts = ARRAY_SIZE(simpad_partitions); } #endif #ifdef CONFIG_SA1100_STORK if (machine_is_stork()) { *parts = stork_partitions; nb_parts = ARRAY_SIZE(stork_partitions); } #endif #ifdef CONFIG_SA1100_TRIZEPS if (machine_is_trizeps()) { *parts = trizeps_partitions; nb_parts = ARRAY_SIZE(trizeps_partitions); } #endif #ifdef CONFIG_SA1100_YOPY if (machine_is_yopy()) { *parts = yopy_partitions; nb_parts = ARRAY_SIZE(yopy_partitions); } #endif return nb_parts; }