···119119 @ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib120120 @ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch121121 @ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S122122- @ln -sfn $(SRC_ARCH)/$(SARCH)/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c122122+ @ln -sfn $(SRC_ARCH)/$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c123123 @touch $@124124125125# Create link to sub arch includes
+1-1
arch/i386/kernel/apic.c
···7777 * completely.7878 * But only ack when the APIC is enabled -AK7979 */8080- if (!cpu_has_apic)8080+ if (cpu_has_apic)8181 ack_APIC_irq();8282}8383
+1
arch/mips/Kconfig
···595595 select SYS_HAS_CPU_R5000596596 select SYS_HAS_CPU_R10000 if BROKEN597597 select SYS_HAS_CPU_RM7000598598+ select SYS_HAS_CPU_NEVADA598599 select SYS_SUPPORTS_64BIT_KERNEL599600 select SYS_SUPPORTS_BIG_ENDIAN600601 help
···55 * License. See the file "COPYING" in the main directory of this archive66 * for more details.77 *88- * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org)88+ * Copyright (C) 1996, 1997, 2004, 05 by Ralf Baechle (ralf@linux-mips.org)99 * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)1010 *1111 */···1313#include <linux/interrupt.h>1414#include <linux/pci.h>1515#include <linux/init.h>1616+#include <linux/pm.h>1617#include <linux/serial.h>1718#include <linux/serial_core.h>1819···2625#include <asm/gt64120.h>2726#include <asm/serial.h>28272929-#include <asm/cobalt/cobalt.h>2828+#include <asm/mach-cobalt/cobalt.h>30293130extern void cobalt_machine_restart(char *command);3231extern void cobalt_machine_halt(void);···10099101100 _machine_restart = cobalt_machine_restart;102101 _machine_halt = cobalt_machine_halt;103103- _machine_power_off = cobalt_machine_power_off;102102+ pm_power_off = cobalt_machine_power_off;104103105104 board_timer_setup = cobalt_timer_setup;106105
+1
arch/mips/configs/ip32_defconfig
···102102# CONFIG_CPU_RM9000 is not set103103# CONFIG_CPU_SB1 is not set104104CONFIG_SYS_HAS_CPU_R5000=y105105+CONFIG_SYS_HAS_CPU_NEVADA=y105106CONFIG_SYS_HAS_CPU_RM7000=y106107CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y107108CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+26-52
arch/mips/configs/qemu_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.15-rc244-# Thu Nov 24 01:07:00 200533+# Linux kernel version: 2.6.16-rc244+# Fri Feb 3 17:14:27 200655#66CONFIG_MIPS=y77···147147# CONFIG_BSD_PROCESS_ACCT is not set148148# CONFIG_SYSCTL is not set149149# CONFIG_AUDIT is not set150150-# CONFIG_HOTPLUG is not set151151-CONFIG_KOBJECT_UEVENT=y152150# CONFIG_IKCONFIG is not set153151CONFIG_INITRAMFS_SOURCE=""154152CONFIG_EMBEDDED=y155153CONFIG_KALLSYMS=y156154# CONFIG_KALLSYMS_EXTRA_PASS is not set155155+# CONFIG_HOTPLUG is not set157156CONFIG_PRINTK=y158157# CONFIG_BUG is not set158158+CONFIG_ELF_CORE=y159159# CONFIG_BASE_FULL is not set160160# CONFIG_FUTEX is not set161161# CONFIG_EPOLL is not set162162-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set163162# CONFIG_SHMEM is not set164163CONFIG_CC_ALIGN_FUNCTIONS=0165164CONFIG_CC_ALIGN_LABELS=0166165CONFIG_CC_ALIGN_LOOPS=0167166CONFIG_CC_ALIGN_JUMPS=0167167+CONFIG_SLAB=y168168CONFIG_TINY_SHMEM=y169169CONFIG_BASE_SMALL=1170170+# CONFIG_SLOB is not set170171171172#172173# Loadable module support···267266# CONFIG_HAMRADIO is not set268267# CONFIG_IRDA is not set269268# CONFIG_BT is not set270270-CONFIG_IEEE80211=y271271-# CONFIG_IEEE80211_DEBUG is not set272272-CONFIG_IEEE80211_CRYPT_WEP=y273273-CONFIG_IEEE80211_CRYPT_CCMP=y274274-CONFIG_IEEE80211_CRYPT_TKIP=y269269+# CONFIG_IEEE80211 is not set275270276271#277272# Device Drivers···320323#321324# SCSI device support322325#323323-CONFIG_RAID_ATTRS=y326326+# CONFIG_RAID_ATTRS is not set324327# CONFIG_SCSI is not set325328326329#···363366#364367# PHY device support365368#366366-CONFIG_PHYLIB=y367367-368368-#369369-# MII PHY device drivers370370-#371371-CONFIG_MARVELL_PHY=y372372-CONFIG_DAVICOM_PHY=y373373-CONFIG_QSEMI_PHY=y374374-CONFIG_LXT_PHY=y375375-CONFIG_CICADA_PHY=y369369+# CONFIG_PHYLIB is not set376370377371#378372# Ethernet (10 or 100Mbit)379373#380374CONFIG_NET_ETHERNET=y381381-CONFIG_MII=y375375+# CONFIG_MII is not set382376# CONFIG_NET_VENDOR_3COM is not set383377# CONFIG_NET_VENDOR_SMC is not set378378+# CONFIG_DM9000 is not set384379# CONFIG_NET_VENDOR_RACAL is not set385380# CONFIG_DEPCA is not set386381# CONFIG_HP100 is not set···468479CONFIG_SERIAL_8250=y469480CONFIG_SERIAL_8250_CONSOLE=y470481CONFIG_SERIAL_8250_NR_UARTS=4482482+CONFIG_SERIAL_8250_RUNTIME_UARTS=4471483# CONFIG_SERIAL_8250_EXTENDED is not set472484473485#···506516# I2C support507517#508518# CONFIG_I2C is not set519519+520520+#521521+# SPI support522522+#523523+# CONFIG_SPI is not set524524+# CONFIG_SPI_MASTER is not set509525510526#511527# Dallas's 1-wire bus···588592#589593590594#595595+# EDAC - error detection and reporting (RAS)596596+#597597+598598+#591599# File systems592600#593601# CONFIG_EXT2_FS is not set594602# CONFIG_EXT3_FS is not set595595-# CONFIG_JBD is not set596603# CONFIG_REISERFS_FS is not set597604# CONFIG_JFS_FS is not set598605# CONFIG_FS_POSIX_ACL is not set···676677# Kernel hacking677678#678679# CONFIG_PRINTK_TIME is not set680680+# CONFIG_MAGIC_SYSRQ is not set679681# CONFIG_DEBUG_KERNEL is not set680682CONFIG_LOG_BUF_SHIFT=14681683CONFIG_CROSSCOMPILE=y···690690#691691# Cryptographic options692692#693693-CONFIG_CRYPTO=y694694-CONFIG_CRYPTO_HMAC=y695695-CONFIG_CRYPTO_NULL=y696696-CONFIG_CRYPTO_MD4=y697697-CONFIG_CRYPTO_MD5=y698698-CONFIG_CRYPTO_SHA1=y699699-CONFIG_CRYPTO_SHA256=y700700-CONFIG_CRYPTO_SHA512=y701701-CONFIG_CRYPTO_WP512=y702702-CONFIG_CRYPTO_TGR192=y703703-CONFIG_CRYPTO_DES=y704704-CONFIG_CRYPTO_BLOWFISH=y705705-CONFIG_CRYPTO_TWOFISH=y706706-CONFIG_CRYPTO_SERPENT=y707707-CONFIG_CRYPTO_AES=y708708-CONFIG_CRYPTO_CAST5=y709709-CONFIG_CRYPTO_CAST6=y710710-CONFIG_CRYPTO_TEA=y711711-CONFIG_CRYPTO_ARC4=y712712-CONFIG_CRYPTO_KHAZAD=y713713-CONFIG_CRYPTO_ANUBIS=y714714-CONFIG_CRYPTO_DEFLATE=y715715-CONFIG_CRYPTO_MICHAEL_MIC=y716716-CONFIG_CRYPTO_CRC32C=y717717-# CONFIG_CRYPTO_TEST is not set693693+# CONFIG_CRYPTO is not set718694719695#720696# Hardware crypto devices···700724# Library routines701725#702726# CONFIG_CRC_CCITT is not set703703-CONFIG_CRC16=y727727+# CONFIG_CRC16 is not set704728CONFIG_CRC32=y705705-CONFIG_LIBCRC32C=y706706-CONFIG_ZLIB_INFLATE=y707707-CONFIG_ZLIB_DEFLATE=y729729+# CONFIG_LIBCRC32C is not set
···8888 ret = -EIO;8989 if (copied != sizeof(tmp))9090 break;9191- ret = put_user(tmp, (unsigned int *) (unsigned long) data);9191+ ret = put_user(tmp, (unsigned int __user *) (unsigned long) data);9292 break;9393 }9494···174174 case FPC_EIR: { /* implementation / version register */175175 unsigned int flags;176176177177- if (!cpu_has_fpu)177177+ if (!cpu_has_fpu) {178178+ tmp = 0;178179 break;180180+ }179181180182 preempt_disable();181183 if (cpu_has_mipsmt) {···196194 preempt_enable();197195 break;198196 }199199- case DSP_BASE ... DSP_BASE + 5:197197+ case DSP_BASE ... DSP_BASE + 5: {198198+ dspreg_t *dregs;199199+200200 if (!cpu_has_dsp) {201201 tmp = 0;202202 ret = -EIO;203203 goto out_tsk;204204 }205205- dspreg_t *dregs = __get_dsp_regs(child);205205+ dregs = __get_dsp_regs(child);206206 tmp = (unsigned long) (dregs[addr - DSP_BASE]);207207 break;208208+ }208209 case DSP_CONTROL:209210 if (!cpu_has_dsp) {210211 tmp = 0;···221216 ret = -EIO;222217 goto out_tsk;223218 }224224- ret = put_user(tmp, (unsigned *) (unsigned long) data);219219+ ret = put_user(tmp, (unsigned __user *) (unsigned long) data);225220 break;226221 }227222···309304 else310305 child->thread.fpu.soft.fcr31 = data;311306 break;312312- case DSP_BASE ... DSP_BASE + 5:307307+ case DSP_BASE ... DSP_BASE + 5: {308308+ dspreg_t *dregs;309309+313310 if (!cpu_has_dsp) {314311 ret = -EIO;315312 break;316313 }317314318318- dspreg_t *dregs = __get_dsp_regs(child);315315+ dregs = __get_dsp_regs(child);319316 dregs[addr - DSP_BASE] = data;320317 break;318318+ }321319 case DSP_CONTROL:322320 if (!cpu_has_dsp) {323321 ret = -EIO;
+8-10
arch/mips/kernel/reset.c
···33 * License. See the file "COPYING" in the main directory of this archive44 * for more details.55 *66- * Copyright (C) 2001 by Ralf Baechle66+ * Copyright (C) 2001, 06 by Ralf Baechle (ralf@linux-mips.org)77 * Copyright (C) 2001 MIPS Technologies, Inc.88 */99#include <linux/kernel.h>1010#include <linux/module.h>1111+#include <linux/pm.h>1112#include <linux/types.h>1213#include <linux/reboot.h>1313-#include <asm/reboot.h>14141515-void (*pm_power_off)(void);1616-EXPORT_SYMBOL(pm_power_off);1515+#include <asm/reboot.h>17161817/*1918 * Urgs ... Too many MIPS machines to handle this in a generic way.···2122 */2223void (*_machine_restart)(char *command);2324void (*_machine_halt)(void);2424-void (*_machine_power_off)(void);2525+void (*pm_power_off)(void);25262627void machine_restart(char *command)2728{2828- _machine_restart(command);2929+ if (_machine_restart)3030+ _machine_restart(command);2931}30323133void machine_halt(void)3234{3333- _machine_halt();3535+ if (_machine_halt)3636+ _machine_halt();3437}35383639void machine_power_off(void)3740{3841 if (pm_power_off)3942 pm_power_off();4040-4141- _machine_power_off();4243}4343-
+4
arch/mips/kernel/rtlx.c
···11/*22 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved.33+ * Copyright (C) 2005, 06 Ralf Baechle (ralf@linux-mips.org)34 *45 * This program is free software; you can distribute it and/or modify it56 * under the terms of the GNU General Public License (Version 2) as···2120#include <linux/module.h>2221#include <linux/fs.h>2322#include <linux/init.h>2323+#include <linux/interrupt.h>2424+#include <linux/irq.h>2425#include <linux/poll.h>2526#include <linux/sched.h>2627#include <linux/wait.h>2828+2729#include <asm/mipsmtregs.h>2830#include <asm/bitops.h>2931#include <asm/cpu.h>
···464464}465465466466struct flush_icache_range_args {467467- unsigned long __user start;468468- unsigned long __user end;467467+ unsigned long start;468468+ unsigned long end;469469};470470471471static inline void local_r4k_flush_icache_range(void *args)···528528 }529529}530530531531-static void r4k_flush_icache_range(unsigned long __user start,532532- unsigned long __user end)531531+static void r4k_flush_icache_range(unsigned long start, unsigned long end)533532{534533 struct flush_icache_range_args args;535534
+2-3
arch/mips/mm/cache.c
···2525 unsigned long end);2626void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page,2727 unsigned long pfn);2828-void (*flush_icache_range)(unsigned long __user start,2929- unsigned long __user end);2828+void (*flush_icache_range)(unsigned long start, unsigned long end);3029void (*flush_icache_page)(struct vm_area_struct *vma, struct page *page);31303231/* MIPS specific cache operations */···5253 * We could optimize the case where the cache argument is not BCACHE but5354 * that seems very atypical use ...5455 */5555-asmlinkage int sys_cacheflush(unsigned long __user addr,5656+asmlinkage int sys_cacheflush(unsigned long addr,5657 unsigned long bytes, unsigned int cache)5758{5859 if (bytes == 0)
+16
arch/mips/mm/init.c
···2424#include <linux/bootmem.h>2525#include <linux/highmem.h>2626#include <linux/swap.h>2727+#include <linux/proc_fs.h>27282829#include <asm/bootinfo.h>2930#include <asm/cachectl.h>···201200 return 0;202201}203202203203+static struct kcore_list kcore_mem, kcore_vmalloc;204204+#ifdef CONFIG_64BIT205205+static struct kcore_list kcore_kseg0;206206+#endif207207+204208void __init mem_init(void)205209{206210 unsigned long codesize, reservedpages, datasize, initsize;···254248 codesize = (unsigned long) &_etext - (unsigned long) &_text;255249 datasize = (unsigned long) &_edata - (unsigned long) &_etext;256250 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;251251+252252+#ifdef CONFIG_64BIT253253+ if ((unsigned long) &_text > (unsigned long) CKSEG0)254254+ /* The -4 is a hack so that user tools don't have to handle255255+ the overflow. */256256+ kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4);257257+#endif258258+ kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);259259+ kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,260260+ VMALLOC_END-VMALLOC_START);257261258262 printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "259263 "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
···7979 case CPU_20KC:8080 case CPU_24K:8181 case CPU_25KF:8282+ case CPU_34K:8383+ case CPU_SB1:8484+ case CPU_SB1A:8285 lmodel = &op_model_mipsxx;8386 break;8487
+11
arch/mips/oprofile/op_model_mipsxx.c
···201201 op_model_mipsxx.cpu_type = "mips/25K";202202 break;203203204204+#ifndef CONFIG_SMP205205+ case CPU_34K:206206+ op_model_mipsxx.cpu_type = "mips/34K";207207+ break;208208+#endif209209+204210 case CPU_5KC:205211 op_model_mipsxx.cpu_type = "mips/5K";212212+ break;213213+214214+ case CPU_SB1:215215+ case CPU_SB1A:216216+ op_model_mipsxx.cpu_type = "mips/sb1";206217 break;207218208219 default:
···1717#include <asm/io.h>1818#include <asm/gt64120.h>19192020-#include <asm/cobalt/cobalt.h>2020+#include <asm/mach-cobalt/cobalt.h>21212222extern int cobalt_board_id;2323···5252 pci_read_config_byte(dev, PCI_LATENCY_TIMER, <);5353 if (lt < 64)5454 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);5555- pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 7);5555+ pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8);5656}57575858DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1,···6969 * host bridge.7070 */7171 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);7272- pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 7);7272+ pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8);73737474 /*7575 * The code described by the comment below has been removed
+1-1
arch/mips/pci/ops-gt64111.c
···1515#include <asm/io.h>1616#include <asm/gt64120.h>17171818-#include <asm/cobalt/cobalt.h>1818+#include <asm/mach-cobalt/cobalt.h>19192020/*2121 * Device 31 on the GT64111 is used to generate PCI special
···33 * License. See the file "COPYING" in the main directory of this archive44 * for more details.55 *66- * Copyright (C) 1997, 1998, 2001, 2003 by Ralf Baechle66+ * Copyright (C) 1997, 1998, 2001, 03, 05, 06 by Ralf Baechle77 */88+#include <linux/linkage.h>89#include <linux/init.h>910#include <linux/ds1286.h>1011#include <linux/module.h>···1312#include <linux/kernel.h>1413#include <linux/sched.h>1514#include <linux/notifier.h>1515+#include <linux/pm.h>1616#include <linux/timer.h>17171818#include <asm/io.h>···43414442#define MACHINE_PANICED 14543#define MACHINE_SHUTTING_DOWN 24646-static int machine_state = 0;47444848-static void sgi_machine_restart(char *command) __attribute__((noreturn));4949-static void sgi_machine_halt(void) __attribute__((noreturn));5050-static void sgi_machine_power_off(void) __attribute__((noreturn));4545+static int machine_state;51465252-static void sgi_machine_restart(char *command)5353-{5454- if (machine_state & MACHINE_SHUTTING_DOWN)5555- sgi_machine_power_off();5656- sgimc->cpuctrl0 |= SGIMC_CCTRL0_SYSINIT;5757- while (1);5858-}5959-6060-static void sgi_machine_halt(void)6161-{6262- if (machine_state & MACHINE_SHUTTING_DOWN)6363- sgi_machine_power_off();6464- ArcEnterInteractiveMode();6565-}6666-6767-static void sgi_machine_power_off(void)4747+static void ATTRIB_NORET sgi_machine_power_off(void)6848{6949 unsigned int tmp;7050···6884 }6985}70868787+static void ATTRIB_NORET sgi_machine_restart(char *command)8888+{8989+ if (machine_state & MACHINE_SHUTTING_DOWN)9090+ sgi_machine_power_off();9191+ sgimc->cpuctrl0 |= SGIMC_CCTRL0_SYSINIT;9292+ while (1);9393+}9494+9595+static void ATTRIB_NORET sgi_machine_halt(void)9696+{9797+ if (machine_state & MACHINE_SHUTTING_DOWN)9898+ sgi_machine_power_off();9999+ ArcEnterInteractiveMode();100100+}101101+71102static void power_timeout(unsigned long data)72103{73104 sgi_machine_power_off();···9495 sgi_ioc_reset ^= (SGIOC_RESET_LC0OFF|SGIOC_RESET_LC1OFF);9596 sgioc->reset = sgi_ioc_reset;96979797- mod_timer(&blink_timer, jiffies+data);9898+ mod_timer(&blink_timer, jiffies + data);9899}99100100101static void debounce(unsigned long data)···102103 del_timer(&debounce_timer);103104 if (sgint->istat1 & SGINT_ISTAT1_PWR) {104105 /* Interrupt still being sent. */105105- debounce_timer.expires = jiffies + 5; /* 0.05s */106106+ debounce_timer.expires = jiffies + (HZ / 20); /* 0.05s */106107 add_timer(&debounce_timer);107108108109 sgioc->panel = SGIOC_PANEL_POWERON | SGIOC_PANEL_POWERINTR |···150151 indy_volume_button(1);151152152153 if (sgint->istat1 & SGINT_ISTAT1_PWR) {153153- volume_timer.expires = jiffies + 1;154154+ volume_timer.expires = jiffies + (HZ / 100);154155 add_timer(&volume_timer);155156 }156157}···163164 indy_volume_button(-1);164165165166 if (sgint->istat1 & SGINT_ISTAT1_PWR) {166166- volume_timer.expires = jiffies + 1;167167+ volume_timer.expires = jiffies + (HZ / 100);167168 add_timer(&volume_timer);168169 }169170}···198199 if (!(buttons & SGIOC_PANEL_VOLUPINTR)) {199200 init_timer(&volume_timer);200201 volume_timer.function = volume_up_button;201201- volume_timer.expires = jiffies + 1;202202+ volume_timer.expires = jiffies + (HZ / 100);202203 add_timer(&volume_timer);203204 }204205 /* Volume down button was pressed */205206 if (!(buttons & SGIOC_PANEL_VOLDNINTR)) {206207 init_timer(&volume_timer);207208 volume_timer.function = volume_down_button;208208- volume_timer.expires = jiffies + 1;209209+ volume_timer.expires = jiffies + (HZ / 100);209210 add_timer(&volume_timer);210211 }211212···233234{234235 _machine_restart = sgi_machine_restart;235236 _machine_halt = sgi_machine_halt;236236- _machine_power_off = sgi_machine_power_off;237237+ pm_power_off = sgi_machine_power_off;237238238239 request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL);239240 init_timer(&blink_timer);
+8-2
arch/mips/sgi-ip22/ip22-setup.c
···5656void __init plat_setup(void)5757{5858 char *ctype;5959+ char *cserial;59606061 board_be_init = ip22_be_init;6162 ip22_time_init();···8281 /* ARCS console environment variable is set to "g?" for8382 * graphics console, it is set to "d" for the first serial8483 * line and "d2" for the second serial line.8484+ *8585+ * Need to check if the case is 'g' but no keyboard:8686+ * (ConsoleIn/Out = serial)8587 */8688 ctype = ArcGetEnvironmentVariable("console");8787- if (ctype && *ctype == 'd') {8989+ cserial = ArcGetEnvironmentVariable("ConsoleOut");9090+9191+ if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {8892 static char options[8];8993 char *baud = ArcGetEnvironmentVariable("dbaud");9094 if (baud)···9791 add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,9892 baud ? options : NULL);9993 } else if (!ctype || *ctype != 'g') {100100- /* Use ARC if we don't want serial ('d') or Newport ('g'). */9494+ /* Use ARC if we don't want serial ('d') or graphics ('g'). */10195 prom_flags |= PROM_FLAG_USE_AS_CONSOLE;10296 add_preferred_console("arc", 0, NULL);10397 }
···1616 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1717 */1818#include <linux/config.h>1919+#include <linux/init.h>1920#include <linux/kernel.h>2021#include <linux/reboot.h>2122#include <linux/string.h>···43424443/* Setup code likely to be common to all SiByte platforms */45444646-static inline int sys_rev_decode(void)4545+static int __init sys_rev_decode(void)4746{4847 int ret = 0;4948···7574 return ret;7675}77767878-static inline int setup_bcm1250(void)7777+static int __init setup_bcm1250(void)7978{8079 int ret = 0;8180···121120 return ret;122121}123122124124-static inline int setup_bcm112x(void)123123+static int __init setup_bcm112x(void)125124{126125 int ret = 0;127126···147146 return ret;148147}149148150150-void sb1250_setup(void)149149+void __init sb1250_setup(void)151150{152151 uint64_t sys_rev;153152 int plldiv;···170169 soc_str, pass_str, zbbus_mhz * 2, sb1_pass);171170 prom_printf("Board type: %s\n", get_system_type());172171173173- switch(war_pass) {172172+ switch (war_pass) {174173 case K_SYS_REVISION_BCM1250_PASS1:175174#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS176176- prom_printf("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, and the kernel doesn't have the proper workarounds compiled in. @@@@\n");175175+ prom_printf("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "176176+ "and the kernel doesn't have the proper "177177+ "workarounds compiled in. @@@@\n");177178 bad_config = 1;178179#endif179180 break;180181 case K_SYS_REVISION_BCM1250_PASS2:181182 /* Pass 2 - easiest as default for now - so many numbers */182182-#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)183183- prom_printf("@@@@ This is a BCM1250 A3-A10 board, and the kernel doesn't have the proper workarounds compiled in. @@@@\n");183183+#if !defined(CONFIG_SB1_PASS_2_WORKAROUNDS) || \184184+ !defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS)185185+ prom_printf("@@@@ This is a BCM1250 A3-A10 board, and the "186186+ "kernel doesn't have the proper workarounds "187187+ "compiled in. @@@@\n");184188 bad_config = 1;185189#endif186190#ifdef CONFIG_CPU_HAS_PREFETCH187187- prom_printf("@@@@ Prefetches may be enabled in this kernel, but are buggy on this board. @@@@\n");191191+ prom_printf("@@@@ Prefetches may be enabled in this kernel, "192192+ "but are buggy on this board. @@@@\n");188193 bad_config = 1;189194#endif190195 break;191196 case K_SYS_REVISION_BCM1250_PASS2_2:192197#ifndef CONFIG_SB1_PASS_2_WORKAROUNDS193193- prom_printf("@@@@ This is a BCM1250 B1/B2. board, and the kernel doesn't have the proper workarounds compiled in. @@@@\n");198198+ prom_printf("@@@@ This is a BCM1250 B1/B2. board, and the "199199+ "kernel doesn't have the proper workarounds "200200+ "compiled in. @@@@\n");194201 bad_config = 1;195202#endif196196-#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || !defined(CONFIG_CPU_HAS_PREFETCH)197197- prom_printf("@@@@ This is a BCM1250 B1/B2, but the kernel is conservatively configured for an 'A' stepping. @@@@\n");203203+#if defined(CONFIG_SB1_PASS_2_1_WORKAROUNDS) || \204204+ !defined(CONFIG_CPU_HAS_PREFETCH)205205+ prom_printf("@@@@ This is a BCM1250 B1/B2, but the kernel is "206206+ "conservatively configured for an 'A' stepping. "207207+ "@@@@\n");198208#endif199209 break;200210 default:
+3-2
arch/mips/sni/setup.c
···55 * License. See the file "COPYING" in the main directory of this archive66 * for more details.77 *88- * Copyright (C) 1996, 97, 98, 2000, 03, 04 Ralf Baechle (ralf@linux-mips.org)88+ * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org)99 */1010#include <linux/config.h>1111#include <linux/eisa.h>···1515#include <linux/init.h>1616#include <linux/interrupt.h>1717#include <linux/mc146818rtc.h>1818+#include <linux/pm.h>1819#include <linux/pci.h>1920#include <linux/console.h>2021#include <linux/fb.h>···190189191190 _machine_restart = sni_machine_restart;192191 _machine_halt = sni_machine_halt;193193- _machine_power_off = sni_machine_power_off;192192+ pm_power_off = sni_machine_power_off;194193195194 sni_display_setup();196195
···21832183{21842184 CommandList_struct *cmd = rq->completion_data;21852185 ctlr_info_t *h = hba[cmd->ctlr];21862186+ unsigned long flags;21862187 u64bit temp64;21872188 int i, ddir;21882189···22062205 printk("Done with %p\n", rq);22072206#endif /* CCISS_DEBUG */ 2208220722092209- spin_lock_irq(&h->lock);22082208+ spin_lock_irqsave(&h->lock, flags);22102209 end_that_request_last(rq, rq->errors);22112210 cmd_free(h, cmd,1);22122212- spin_unlock_irq(&h->lock);22112211+ spin_unlock_irqrestore(&h->lock, flags);22132212}2214221322152214/* checks the status of the job and calls complete buffers to mark all
···116116117117int flexcop_dma_control_timer_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff);118118int flexcop_dma_control_size_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff);119119-int flexcop_dma_control_packet_irq(struct flexcop_device *fc, flexcop_dma_index_t no, int onoff);120119int flexcop_dma_config(struct flexcop_device *fc, struct flexcop_dma *dma, flexcop_dma_index_t dma_idx);121120int flexcop_dma_xfer_control(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, flexcop_dma_addr_index_t index, int onoff);122121int flexcop_dma_config_timer(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, u8 cycles);123123-int flexcop_dma_config_packet_count(struct flexcop_device *fc, flexcop_dma_index_t dma_idx, u8 packets);124122125123/* from flexcop-eeprom.c */126124/* the PCI part uses this call to get the MAC address, the USB part has its own */
-35
drivers/media/dvb/b2c2/flexcop-dma.c
···169169}170170EXPORT_SYMBOL(flexcop_dma_config_timer);171171172172-/* packet IRQ does not exist in FCII or FCIIb - according to data book and tests */173173-int flexcop_dma_control_packet_irq(struct flexcop_device *fc,174174- flexcop_dma_index_t no,175175- int onoff)176176-{177177- flexcop_ibi_value v = fc->read_ibi_reg(fc,ctrl_208);178178-179179- deb_rdump("reg: %03x: %x\n",ctrl_208,v.raw);180180- if (no & FC_DMA_1)181181- v.ctrl_208.DMA1_Size_IRQ_Enable_sig = onoff;182182-183183- if (no & FC_DMA_2)184184- v.ctrl_208.DMA2_Size_IRQ_Enable_sig = onoff;185185-186186- fc->write_ibi_reg(fc,ctrl_208,v);187187- deb_rdump("reg: %03x: %x\n",ctrl_208,v.raw);188188-189189- return 0;190190-}191191-EXPORT_SYMBOL(flexcop_dma_control_packet_irq);192192-193193-int flexcop_dma_config_packet_count(struct flexcop_device *fc,194194- flexcop_dma_index_t dma_idx,195195- u8 packets)196196-{197197- flexcop_ibi_register r = (dma_idx & FC_DMA_1) ? dma1_004 : dma2_014;198198- flexcop_ibi_value v = fc->read_ibi_reg(fc,r);199199-200200- flexcop_dma_remap(fc,dma_idx,1);201201-202202- v.dma_0x4_remap.DMA_maxpackets = packets;203203- fc->write_ibi_reg(fc,r,v);204204- return 0;205205-}206206-EXPORT_SYMBOL(flexcop_dma_config_packet_count);
···8383 Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver.84848585config DVB_USB_CXUSB8686- tristate "Medion MD95700 hybrid USB2.0 (Conexant) support"8686+ tristate "Conexant USB2.0 hybrid reference design support"8787 depends on DVB_USB8888 select DVB_CX227028989+ select DVB_LGDT330X9090+ select DVB_MT3528991 help9090- Say Y here to support the Medion MD95700 hybrid USB2.0 device. Currently9191- only the DVB-T part is supported.9292+ Say Y here to support the Conexant USB2.0 hybrid reference design.9393+ Currently, only DVB and ATSC modes are supported, analog mode9494+ shall be added in the future. Devices that require this module:9595+9696+ Medion MD95700 hybrid USB2.0 device.9797+ DViCO FusionHDTV (Bluebird) USB2.0 devices92989399config DVB_USB_DIGITV94100 tristate "Nebula Electronics uDigiTV DVB-T USB2.0 support"
···2828 help2929 A DVB-S tuner module. Say Y when you want to support this frontend.30303131-config DVB_TDA80XX3232- tristate "Philips TDA8044 or TDA8083 based"3333- depends on DVB_CORE3434- help3535- A DVB-S tuner module. Say Y when you want to support this frontend.3636-3731config DVB_MT3123832 tristate "Zarlink MT312 based"3933 depends on DVB_CORE···133139comment "DVB-C (cable) frontends"134140 depends on DVB_CORE135141136136-config DVB_ATMEL_AT76C651137137- tristate "Atmel AT76C651 based"138138- depends on DVB_CORE139139- help140140- A DVB-C tuner module. Say Y when you want to support this frontend.141141-142142config DVB_VES1820143143 tristate "VLSI VES1820 based"144144 depends on DVB_CORE···153165154166comment "ATSC (North American/Korean Terresterial DTV) frontends"155167 depends on DVB_CORE156156-157157-config DVB_NXT2002158158- tristate "Nxt2002 based"159159- depends on DVB_CORE160160- select FW_LOADER161161- help162162- An ATSC 8VSB tuner module. Say Y when you want to support this frontend.163163-164164- This driver needs external firmware. Please use the command165165- "<kerneldir>/Documentation/dvb/get_dvb_firmware nxt2002" to166166- download/extract it, and then copy it to /usr/lib/hotplug/firmware167167- or /lib/firmware (depending on configuration of firmware hotplug).168168169169config DVB_NXT200X170170 tristate "Nextwave NXT2002/NXT2004 based"
···11-/*22- * at76c651.c33- *44- * Atmel DVB-C Frontend Driver (at76c651/tua6010xs)55- *66- * Copyright (C) 2001 fnbrd <fnbrd@gmx.de>77- * & 2002-2004 Andreas Oberritter <obi@linuxtv.org>88- * & 2003 Wolfram Joost <dbox2@frokaschwei.de>99- *1010- * This program is free software; you can redistribute it and/or modify1111- * it under the terms of the GNU General Public License as published by1212- * the Free Software Foundation; either version 2 of the License, or1313- * (at your option) any later version.1414- *1515- * This program is distributed in the hope that it will be useful,1616- * but WITHOUT ANY WARRANTY; without even the implied warranty of1717- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1818- * GNU General Public License for more details.1919- *2020- * You should have received a copy of the GNU General Public License2121- * along with this program; if not, write to the Free Software2222- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2323- *2424- * AT76C6512525- * http://www.nalanda.nitc.ac.in/industry/datasheets/atmel/acrobat/doc1293.pdf2626- * http://www.atmel.com/atmel/acrobat/doc1320.pdf2727- */2828-2929-#include <linux/init.h>3030-#include <linux/module.h>3131-#include <linux/moduleparam.h>3232-#include <linux/kernel.h>3333-#include <linux/string.h>3434-#include <linux/slab.h>3535-#include <linux/bitops.h>3636-#include "dvb_frontend.h"3737-#include "at76c651.h"3838-3939-4040-struct at76c651_state {4141-4242- struct i2c_adapter* i2c;4343-4444- struct dvb_frontend_ops ops;4545-4646- const struct at76c651_config* config;4747-4848- struct dvb_frontend frontend;4949-5050- /* revision of the chip */5151- u8 revision;5252-5353- /* last QAM value set */5454- u8 qam;5555-};5656-5757-static int debug;5858-#define dprintk(args...) \5959- do { \6060- if (debug) printk(KERN_DEBUG "at76c651: " args); \6161- } while (0)6262-6363-6464-#if ! defined(__powerpc__)6565-static __inline__ int __ilog2(unsigned long x)6666-{6767- int i;6868-6969- if (x == 0)7070- return -1;7171-7272- for (i = 0; x != 0; i++)7373- x >>= 1;7474-7575- return i - 1;7676-}7777-#endif7878-7979-static int at76c651_writereg(struct at76c651_state* state, u8 reg, u8 data)8080-{8181- int ret;8282- u8 buf[] = { reg, data };8383- struct i2c_msg msg =8484- { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };8585-8686- ret = i2c_transfer(state->i2c, &msg, 1);8787-8888- if (ret != 1)8989- dprintk("%s: writereg error "9090- "(reg == 0x%02x, val == 0x%02x, ret == %i)\n",9191- __FUNCTION__, reg, data, ret);9292-9393- msleep(10);9494-9595- return (ret != 1) ? -EREMOTEIO : 0;9696-}9797-9898-static u8 at76c651_readreg(struct at76c651_state* state, u8 reg)9999-{100100- int ret;101101- u8 val;102102- struct i2c_msg msg[] = {103103- { .addr = state->config->demod_address, .flags = 0, .buf = ®, .len = 1 },104104- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = &val, .len = 1 }105105- };106106-107107- ret = i2c_transfer(state->i2c, msg, 2);108108-109109- if (ret != 2)110110- dprintk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret);111111-112112- return val;113113-}114114-115115-static int at76c651_reset(struct at76c651_state* state)116116-{117117- return at76c651_writereg(state, 0x07, 0x01);118118-}119119-120120-static void at76c651_disable_interrupts(struct at76c651_state* state)121121-{122122- at76c651_writereg(state, 0x0b, 0x00);123123-}124124-125125-static int at76c651_set_auto_config(struct at76c651_state *state)126126-{127127- /*128128- * Autoconfig129129- */130130-131131- at76c651_writereg(state, 0x06, 0x01);132132-133133- /*134134- * Performance optimizations, should be done after autoconfig135135- */136136-137137- at76c651_writereg(state, 0x10, 0x06);138138- at76c651_writereg(state, 0x11, ((state->qam == 5) || (state->qam == 7)) ? 0x12 : 0x10);139139- at76c651_writereg(state, 0x15, 0x28);140140- at76c651_writereg(state, 0x20, 0x09);141141- at76c651_writereg(state, 0x24, ((state->qam == 5) || (state->qam == 7)) ? 0xC0 : 0x90);142142- at76c651_writereg(state, 0x30, 0x90);143143- if (state->qam == 5)144144- at76c651_writereg(state, 0x35, 0x2A);145145-146146- /*147147- * Initialize A/D-converter148148- */149149-150150- if (state->revision == 0x11) {151151- at76c651_writereg(state, 0x2E, 0x38);152152- at76c651_writereg(state, 0x2F, 0x13);153153- }154154-155155- at76c651_disable_interrupts(state);156156-157157- /*158158- * Restart operation159159- */160160-161161- at76c651_reset(state);162162-163163- return 0;164164-}165165-166166-static void at76c651_set_bbfreq(struct at76c651_state* state)167167-{168168- at76c651_writereg(state, 0x04, 0x3f);169169- at76c651_writereg(state, 0x05, 0xee);170170-}171171-172172-static int at76c651_set_symbol_rate(struct at76c651_state* state, u32 symbol_rate)173173-{174174- u8 exponent;175175- u32 mantissa;176176-177177- if (symbol_rate > 9360000)178178- return -EINVAL;179179-180180- /*181181- * FREF = 57800 kHz182182- * exponent = 10 + floor (log2(symbol_rate / FREF))183183- * mantissa = (symbol_rate / FREF) * (1 << (30 - exponent))184184- */185185-186186- exponent = __ilog2((symbol_rate << 4) / 903125);187187- mantissa = ((symbol_rate / 3125) * (1 << (24 - exponent))) / 289;188188-189189- at76c651_writereg(state, 0x00, mantissa >> 13);190190- at76c651_writereg(state, 0x01, mantissa >> 5);191191- at76c651_writereg(state, 0x02, (mantissa << 3) | exponent);192192-193193- return 0;194194-}195195-196196-static int at76c651_set_qam(struct at76c651_state *state, fe_modulation_t qam)197197-{198198- switch (qam) {199199- case QPSK:200200- state->qam = 0x02;201201- break;202202- case QAM_16:203203- state->qam = 0x04;204204- break;205205- case QAM_32:206206- state->qam = 0x05;207207- break;208208- case QAM_64:209209- state->qam = 0x06;210210- break;211211- case QAM_128:212212- state->qam = 0x07;213213- break;214214- case QAM_256:215215- state->qam = 0x08;216216- break;217217-#if 0218218- case QAM_512:219219- state->qam = 0x09;220220- break;221221- case QAM_1024:222222- state->qam = 0x0A;223223- break;224224-#endif225225- default:226226- return -EINVAL;227227-228228- }229229-230230- return at76c651_writereg(state, 0x03, state->qam);231231-}232232-233233-static int at76c651_set_inversion(struct at76c651_state* state, fe_spectral_inversion_t inversion)234234-{235235- u8 feciqinv = at76c651_readreg(state, 0x60);236236-237237- switch (inversion) {238238- case INVERSION_OFF:239239- feciqinv |= 0x02;240240- feciqinv &= 0xFE;241241- break;242242-243243- case INVERSION_ON:244244- feciqinv |= 0x03;245245- break;246246-247247- case INVERSION_AUTO:248248- feciqinv &= 0xFC;249249- break;250250-251251- default:252252- return -EINVAL;253253- }254254-255255- return at76c651_writereg(state, 0x60, feciqinv);256256-}257257-258258-static int at76c651_set_parameters(struct dvb_frontend* fe,259259- struct dvb_frontend_parameters *p)260260-{261261- int ret;262262- struct at76c651_state* state = fe->demodulator_priv;263263-264264- at76c651_writereg(state, 0x0c, 0xc3);265265- state->config->pll_set(fe, p);266266- at76c651_writereg(state, 0x0c, 0xc2);267267-268268- if ((ret = at76c651_set_symbol_rate(state, p->u.qam.symbol_rate)))269269- return ret;270270-271271- if ((ret = at76c651_set_inversion(state, p->inversion)))272272- return ret;273273-274274- return at76c651_set_auto_config(state);275275-}276276-277277-static int at76c651_set_defaults(struct dvb_frontend* fe)278278-{279279- struct at76c651_state* state = fe->demodulator_priv;280280-281281- at76c651_set_symbol_rate(state, 6900000);282282- at76c651_set_qam(state, QAM_64);283283- at76c651_set_bbfreq(state);284284- at76c651_set_auto_config(state);285285-286286- if (state->config->pll_init) {287287- at76c651_writereg(state, 0x0c, 0xc3);288288- state->config->pll_init(fe);289289- at76c651_writereg(state, 0x0c, 0xc2);290290- }291291-292292- return 0;293293-}294294-295295-static int at76c651_read_status(struct dvb_frontend* fe, fe_status_t* status)296296-{297297- struct at76c651_state* state = fe->demodulator_priv;298298- u8 sync;299299-300300- /*301301- * Bits: FEC, CAR, EQU, TIM, AGC2, AGC1, ADC, PLL (PLL=0)302302- */303303- sync = at76c651_readreg(state, 0x80);304304- *status = 0;305305-306306- if (sync & (0x04 | 0x10)) /* AGC1 || TIM */307307- *status |= FE_HAS_SIGNAL;308308- if (sync & 0x10) /* TIM */309309- *status |= FE_HAS_CARRIER;310310- if (sync & 0x80) /* FEC */311311- *status |= FE_HAS_VITERBI;312312- if (sync & 0x40) /* CAR */313313- *status |= FE_HAS_SYNC;314314- if ((sync & 0xF0) == 0xF0) /* TIM && EQU && CAR && FEC */315315- *status |= FE_HAS_LOCK;316316-317317- return 0;318318-}319319-320320-static int at76c651_read_ber(struct dvb_frontend* fe, u32* ber)321321-{322322- struct at76c651_state* state = fe->demodulator_priv;323323-324324- *ber = (at76c651_readreg(state, 0x81) & 0x0F) << 16;325325- *ber |= at76c651_readreg(state, 0x82) << 8;326326- *ber |= at76c651_readreg(state, 0x83);327327- *ber *= 10;328328-329329- return 0;330330-}331331-332332-static int at76c651_read_signal_strength(struct dvb_frontend* fe, u16* strength)333333-{334334- struct at76c651_state* state = fe->demodulator_priv;335335-336336- u8 gain = ~at76c651_readreg(state, 0x91);337337- *strength = (gain << 8) | gain;338338-339339- return 0;340340-}341341-342342-static int at76c651_read_snr(struct dvb_frontend* fe, u16* snr)343343-{344344- struct at76c651_state* state = fe->demodulator_priv;345345-346346- *snr = 0xFFFF -347347- ((at76c651_readreg(state, 0x8F) << 8) |348348- at76c651_readreg(state, 0x90));349349-350350- return 0;351351-}352352-353353-static int at76c651_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)354354-{355355- struct at76c651_state* state = fe->demodulator_priv;356356-357357- *ucblocks = at76c651_readreg(state, 0x82);358358-359359- return 0;360360-}361361-362362-static int at76c651_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *fesettings)363363-{364364- fesettings->min_delay_ms = 50;365365- fesettings->step_size = 0;366366- fesettings->max_drift = 0;367367- return 0;368368-}369369-370370-static void at76c651_release(struct dvb_frontend* fe)371371-{372372- struct at76c651_state* state = fe->demodulator_priv;373373- kfree(state);374374-}375375-376376-static struct dvb_frontend_ops at76c651_ops;377377-378378-struct dvb_frontend* at76c651_attach(const struct at76c651_config* config,379379- struct i2c_adapter* i2c)380380-{381381- struct at76c651_state* state = NULL;382382-383383- /* allocate memory for the internal state */384384- state = kmalloc(sizeof(struct at76c651_state), GFP_KERNEL);385385- if (state == NULL) goto error;386386-387387- /* setup the state */388388- state->config = config;389389- state->qam = 0;390390-391391- /* check if the demod is there */392392- if (at76c651_readreg(state, 0x0e) != 0x65) goto error;393393-394394- /* finalise state setup */395395- state->i2c = i2c;396396- state->revision = at76c651_readreg(state, 0x0f) & 0xfe;397397- memcpy(&state->ops, &at76c651_ops, sizeof(struct dvb_frontend_ops));398398-399399- /* create dvb_frontend */400400- state->frontend.ops = &state->ops;401401- state->frontend.demodulator_priv = state;402402- return &state->frontend;403403-404404-error:405405- kfree(state);406406- return NULL;407407-}408408-409409-static struct dvb_frontend_ops at76c651_ops = {410410-411411- .info = {412412- .name = "Atmel AT76C651B DVB-C",413413- .type = FE_QAM,414414- .frequency_min = 48250000,415415- .frequency_max = 863250000,416416- .frequency_stepsize = 62500,417417- /*.frequency_tolerance = */ /* FIXME: 12% of SR */418418- .symbol_rate_min = 0, /* FIXME */419419- .symbol_rate_max = 9360000, /* FIXME */420420- .symbol_rate_tolerance = 4000,421421- .caps = FE_CAN_INVERSION_AUTO |422422- FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |423423- FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |424424- FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |425425- FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | FE_CAN_QAM_128 |426426- FE_CAN_MUTE_TS | FE_CAN_QAM_256 | FE_CAN_RECOVER427427- },428428-429429- .release = at76c651_release,430430-431431- .init = at76c651_set_defaults,432432-433433- .set_frontend = at76c651_set_parameters,434434- .get_tune_settings = at76c651_get_tune_settings,435435-436436- .read_status = at76c651_read_status,437437- .read_ber = at76c651_read_ber,438438- .read_signal_strength = at76c651_read_signal_strength,439439- .read_snr = at76c651_read_snr,440440- .read_ucblocks = at76c651_read_ucblocks,441441-};442442-443443-module_param(debug, int, 0644);444444-MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");445445-446446-MODULE_DESCRIPTION("Atmel AT76C651 DVB-C Demodulator Driver");447447-MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>");448448-MODULE_LICENSE("GPL");449449-450450-EXPORT_SYMBOL(at76c651_attach);
-47
drivers/media/dvb/frontends/at76c651.h
···11-/*22- * at76c651.c33- *44- * Atmel DVB-C Frontend Driver (at76c651)55- *66- * Copyright (C) 2001 fnbrd <fnbrd@gmx.de>77- * & 2002-2004 Andreas Oberritter <obi@linuxtv.org>88- * & 2003 Wolfram Joost <dbox2@frokaschwei.de>99- *1010- * This program is free software; you can redistribute it and/or modify1111- * it under the terms of the GNU General Public License as published by1212- * the Free Software Foundation; either version 2 of the License, or1313- * (at your option) any later version.1414- *1515- * This program is distributed in the hope that it will be useful,1616- * but WITHOUT ANY WARRANTY; without even the implied warranty of1717- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1818- * GNU General Public License for more details.1919- *2020- * You should have received a copy of the GNU General Public License2121- * along with this program; if not, write to the Free Software2222- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2323- *2424- * AT76C6512525- * http://www.nalanda.nitc.ac.in/industry/datasheets/atmel/acrobat/doc1293.pdf2626- * http://www.atmel.com/atmel/acrobat/doc1320.pdf2727- */2828-2929-#ifndef AT76C651_H3030-#define AT76C651_H3131-3232-#include <linux/dvb/frontend.h>3333-3434-struct at76c651_config3535-{3636- /* the demodulator's i2c address */3737- u8 demod_address;3838-3939- /* PLL maintenance */4040- int (*pll_init)(struct dvb_frontend* fe);4141- int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);4242-};4343-4444-extern struct dvb_frontend* at76c651_attach(const struct at76c651_config* config,4545- struct i2c_adapter* i2c);4646-4747-#endif // AT76C651_H
···11-/*22- Support for B2C2/BBTI Technisat Air2PC - ATSC33-44- Copyright (C) 2004 Taylor Jacob <rtjacob@earthlink.net>55-66- This program is free software; you can redistribute it and/or modify77- it under the terms of the GNU General Public License as published by88- the Free Software Foundation; either version 2 of the License, or99- (at your option) any later version.1010-1111- This program is distributed in the hope that it will be useful,1212- but WITHOUT ANY WARRANTY; without even the implied warranty of1313- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1414- GNU General Public License for more details.1515-1616- You should have received a copy of the GNU General Public License1717- along with this program; if not, write to the Free Software1818- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.1919-2020-*/2121-2222-/*2323- * This driver needs external firmware. Please use the command2424- * "<kerneldir>/Documentation/dvb/get_dvb_firmware nxt2002" to2525- * download/extract it, and then copy it to /usr/lib/hotplug/firmware2626- * or /lib/firmware (depending on configuration of firmware hotplug).2727- */2828-#define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw"2929-#define CRC_CCIT_MASK 0x10213030-3131-#include <linux/init.h>3232-#include <linux/module.h>3333-#include <linux/moduleparam.h>3434-#include <linux/device.h>3535-#include <linux/firmware.h>3636-#include <linux/string.h>3737-#include <linux/slab.h>3838-3939-#include "dvb_frontend.h"4040-#include "nxt2002.h"4141-4242-struct nxt2002_state {4343-4444- struct i2c_adapter* i2c;4545- struct dvb_frontend_ops ops;4646- const struct nxt2002_config* config;4747- struct dvb_frontend frontend;4848-4949- /* demodulator private data */5050- u8 initialised:1;5151-};5252-5353-static int debug;5454-#define dprintk(args...) \5555- do { \5656- if (debug) printk(KERN_DEBUG "nxt2002: " args); \5757- } while (0)5858-5959-static int i2c_writebytes (struct nxt2002_state* state, u8 reg, u8 *buf, u8 len)6060-{6161- /* probbably a much better way or doing this */6262- u8 buf2 [256],x;6363- int err;6464- struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 };6565-6666- buf2[0] = reg;6767- for (x = 0 ; x < len ; x++)6868- buf2[x+1] = buf[x];6969-7070- if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {7171- printk ("%s: i2c write error (addr %02x, err == %i)\n",7272- __FUNCTION__, state->config->demod_address, err);7373- return -EREMOTEIO;7474- }7575-7676- return 0;7777-}7878-7979-static u8 i2c_readbytes (struct nxt2002_state* state, u8 reg, u8* buf, u8 len)8080-{8181- u8 reg2 [] = { reg };8282-8383- struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = reg2, .len = 1 },8484- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } };8585-8686- int err;8787-8888- if ((err = i2c_transfer (state->i2c, msg, 2)) != 2) {8989- printk ("%s: i2c read error (addr %02x, err == %i)\n",9090- __FUNCTION__, state->config->demod_address, err);9191- return -EREMOTEIO;9292- }9393-9494- return 0;9595-}9696-9797-static u16 nxt2002_crc(u16 crc, u8 c)9898-{9999-100100- u8 i;101101- u16 input = (u16) c & 0xFF;102102-103103- input<<=8;104104- for(i=0 ;i<8 ;i++) {105105- if((crc ^ input) & 0x8000)106106- crc=(crc<<1)^CRC_CCIT_MASK;107107- else108108- crc<<=1;109109- input<<=1;110110- }111111- return crc;112112-}113113-114114-static int nxt2002_writereg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len)115115-{116116- u8 buf;117117- dprintk("%s\n", __FUNCTION__);118118-119119- /* set multi register length */120120- i2c_writebytes(state,0x34,&len,1);121121-122122- /* set mutli register register */123123- i2c_writebytes(state,0x35,®,1);124124-125125- /* send the actual data */126126- i2c_writebytes(state,0x36,data,len);127127-128128- /* toggle the multireg write bit*/129129- buf = 0x02;130130- i2c_writebytes(state,0x21,&buf,1);131131-132132- i2c_readbytes(state,0x21,&buf,1);133133-134134- if ((buf & 0x02) == 0)135135- return 0;136136-137137- dprintk("Error writing multireg register %02X\n",reg);138138-139139- return 0;140140-}141141-142142-static int nxt2002_readreg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len)143143-{144144- u8 len2;145145- dprintk("%s\n", __FUNCTION__);146146-147147- /* set multi register length */148148- len2 = len & 0x80;149149- i2c_writebytes(state,0x34,&len2,1);150150-151151- /* set mutli register register */152152- i2c_writebytes(state,0x35,®,1);153153-154154- /* send the actual data */155155- i2c_readbytes(state,reg,data,len);156156-157157- return 0;158158-}159159-160160-static void nxt2002_microcontroller_stop (struct nxt2002_state* state)161161-{162162- u8 buf[2],counter = 0;163163- dprintk("%s\n", __FUNCTION__);164164-165165- buf[0] = 0x80;166166- i2c_writebytes(state,0x22,buf,1);167167-168168- while (counter < 20) {169169- i2c_readbytes(state,0x31,buf,1);170170- if (buf[0] & 0x40)171171- return;172172- msleep(10);173173- counter++;174174- }175175-176176- dprintk("Timeout waiting for micro to stop.. This is ok after firmware upload\n");177177- return;178178-}179179-180180-static void nxt2002_microcontroller_start (struct nxt2002_state* state)181181-{182182- u8 buf;183183- dprintk("%s\n", __FUNCTION__);184184-185185- buf = 0x00;186186- i2c_writebytes(state,0x22,&buf,1);187187-}188188-189189-static int nxt2002_writetuner (struct nxt2002_state* state, u8* data)190190-{191191- u8 buf,count = 0;192192-193193- dprintk("Tuner Bytes: %02X %02X %02X %02X\n",data[0],data[1],data[2],data[3]);194194-195195- dprintk("%s\n", __FUNCTION__);196196- /* stop the micro first */197197- nxt2002_microcontroller_stop(state);198198-199199- /* set the i2c transfer speed to the tuner */200200- buf = 0x03;201201- i2c_writebytes(state,0x20,&buf,1);202202-203203- /* setup to transfer 4 bytes via i2c */204204- buf = 0x04;205205- i2c_writebytes(state,0x34,&buf,1);206206-207207- /* write actual tuner bytes */208208- i2c_writebytes(state,0x36,data,4);209209-210210- /* set tuner i2c address */211211- buf = 0xC2;212212- i2c_writebytes(state,0x35,&buf,1);213213-214214- /* write UC Opmode to begin transfer */215215- buf = 0x80;216216- i2c_writebytes(state,0x21,&buf,1);217217-218218- while (count < 20) {219219- i2c_readbytes(state,0x21,&buf,1);220220- if ((buf & 0x80)== 0x00)221221- return 0;222222- msleep(100);223223- count++;224224- }225225-226226- printk("nxt2002: timeout error writing tuner\n");227227- return 0;228228-}229229-230230-static void nxt2002_agc_reset(struct nxt2002_state* state)231231-{232232- u8 buf;233233- dprintk("%s\n", __FUNCTION__);234234-235235- buf = 0x08;236236- i2c_writebytes(state,0x08,&buf,1);237237-238238- buf = 0x00;239239- i2c_writebytes(state,0x08,&buf,1);240240-241241- return;242242-}243243-244244-static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)245245-{246246-247247- struct nxt2002_state* state = fe->demodulator_priv;248248- u8 buf[256],written = 0,chunkpos = 0;249249- u16 rambase,position,crc = 0;250250-251251- dprintk("%s\n", __FUNCTION__);252252- dprintk("Firmware is %zu bytes\n",fw->size);253253-254254- /* Get the RAM base for this nxt2002 */255255- i2c_readbytes(state,0x10,buf,1);256256-257257- if (buf[0] & 0x10)258258- rambase = 0x1000;259259- else260260- rambase = 0x0000;261261-262262- dprintk("rambase on this nxt2002 is %04X\n",rambase);263263-264264- /* Hold the micro in reset while loading firmware */265265- buf[0] = 0x80;266266- i2c_writebytes(state,0x2B,buf,1);267267-268268- for (position = 0; position < fw->size ; position++) {269269- if (written == 0) {270270- crc = 0;271271- chunkpos = 0x28;272272- buf[0] = ((rambase + position) >> 8);273273- buf[1] = (rambase + position) & 0xFF;274274- buf[2] = 0x81;275275- /* write starting address */276276- i2c_writebytes(state,0x29,buf,3);277277- }278278- written++;279279- chunkpos++;280280-281281- if ((written % 4) == 0)282282- i2c_writebytes(state,chunkpos,&fw->data[position-3],4);283283-284284- crc = nxt2002_crc(crc,fw->data[position]);285285-286286- if ((written == 255) || (position+1 == fw->size)) {287287- /* write remaining bytes of firmware */288288- i2c_writebytes(state, chunkpos+4-(written %4),289289- &fw->data[position-(written %4) + 1],290290- written %4);291291- buf[0] = crc << 8;292292- buf[1] = crc & 0xFF;293293-294294- /* write crc */295295- i2c_writebytes(state,0x2C,buf,2);296296-297297- /* do a read to stop things */298298- i2c_readbytes(state,0x2A,buf,1);299299-300300- /* set transfer mode to complete */301301- buf[0] = 0x80;302302- i2c_writebytes(state,0x2B,buf,1);303303-304304- written = 0;305305- }306306- }307307-308308- printk ("done.\n");309309- return 0;310310-};311311-312312-static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe,313313- struct dvb_frontend_parameters *p)314314-{315315- struct nxt2002_state* state = fe->demodulator_priv;316316- u32 freq = 0;317317- u16 tunerfreq = 0;318318- u8 buf[4];319319-320320- freq = 44000 + ( p->frequency / 1000 );321321-322322- dprintk("freq = %d p->frequency = %d\n",freq,p->frequency);323323-324324- tunerfreq = freq * 24/4000;325325-326326- buf[0] = (tunerfreq >> 8) & 0x7F;327327- buf[1] = (tunerfreq & 0xFF);328328-329329- if (p->frequency <= 214000000) {330330- buf[2] = 0x84 + (0x06 << 3);331331- buf[3] = (p->frequency <= 172000000) ? 0x01 : 0x02;332332- } else if (p->frequency <= 721000000) {333333- buf[2] = 0x84 + (0x07 << 3);334334- buf[3] = (p->frequency <= 467000000) ? 0x02 : 0x08;335335- } else if (p->frequency <= 841000000) {336336- buf[2] = 0x84 + (0x0E << 3);337337- buf[3] = 0x08;338338- } else {339339- buf[2] = 0x84 + (0x0F << 3);340340- buf[3] = 0x02;341341- }342342-343343- /* write frequency information */344344- nxt2002_writetuner(state,buf);345345-346346- /* reset the agc now that tuning has been completed */347347- nxt2002_agc_reset(state);348348-349349- /* set target power level */350350- switch (p->u.vsb.modulation) {351351- case QAM_64:352352- case QAM_256:353353- buf[0] = 0x74;354354- break;355355- case VSB_8:356356- buf[0] = 0x70;357357- break;358358- default:359359- return -EINVAL;360360- break;361361- }362362- i2c_writebytes(state,0x42,buf,1);363363-364364- /* configure sdm */365365- buf[0] = 0x87;366366- i2c_writebytes(state,0x57,buf,1);367367-368368- /* write sdm1 input */369369- buf[0] = 0x10;370370- buf[1] = 0x00;371371- nxt2002_writereg_multibyte(state,0x58,buf,2);372372-373373- /* write sdmx input */374374- switch (p->u.vsb.modulation) {375375- case QAM_64:376376- buf[0] = 0x68;377377- break;378378- case QAM_256:379379- buf[0] = 0x64;380380- break;381381- case VSB_8:382382- buf[0] = 0x60;383383- break;384384- default:385385- return -EINVAL;386386- break;387387- }388388- buf[1] = 0x00;389389- nxt2002_writereg_multibyte(state,0x5C,buf,2);390390-391391- /* write adc power lpf fc */392392- buf[0] = 0x05;393393- i2c_writebytes(state,0x43,buf,1);394394-395395- /* write adc power lpf fc */396396- buf[0] = 0x05;397397- i2c_writebytes(state,0x43,buf,1);398398-399399- /* write accumulator2 input */400400- buf[0] = 0x80;401401- buf[1] = 0x00;402402- nxt2002_writereg_multibyte(state,0x4B,buf,2);403403-404404- /* write kg1 */405405- buf[0] = 0x00;406406- i2c_writebytes(state,0x4D,buf,1);407407-408408- /* write sdm12 lpf fc */409409- buf[0] = 0x44;410410- i2c_writebytes(state,0x55,buf,1);411411-412412- /* write agc control reg */413413- buf[0] = 0x04;414414- i2c_writebytes(state,0x41,buf,1);415415-416416- /* write agc ucgp0 */417417- switch (p->u.vsb.modulation) {418418- case QAM_64:419419- buf[0] = 0x02;420420- break;421421- case QAM_256:422422- buf[0] = 0x03;423423- break;424424- case VSB_8:425425- buf[0] = 0x00;426426- break;427427- default:428428- return -EINVAL;429429- break;430430- }431431- i2c_writebytes(state,0x30,buf,1);432432-433433- /* write agc control reg */434434- buf[0] = 0x00;435435- i2c_writebytes(state,0x41,buf,1);436436-437437- /* write accumulator2 input */438438- buf[0] = 0x80;439439- buf[1] = 0x00;440440- nxt2002_writereg_multibyte(state,0x49,buf,2);441441- nxt2002_writereg_multibyte(state,0x4B,buf,2);442442-443443- /* write agc control reg */444444- buf[0] = 0x04;445445- i2c_writebytes(state,0x41,buf,1);446446-447447- nxt2002_microcontroller_start(state);448448-449449- /* adjacent channel detection should be done here, but I don't450450- have any stations with this need so I cannot test it */451451-452452- return 0;453453-}454454-455455-static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status)456456-{457457- struct nxt2002_state* state = fe->demodulator_priv;458458- u8 lock;459459- i2c_readbytes(state,0x31,&lock,1);460460-461461- *status = 0;462462- if (lock & 0x20) {463463- *status |= FE_HAS_SIGNAL;464464- *status |= FE_HAS_CARRIER;465465- *status |= FE_HAS_VITERBI;466466- *status |= FE_HAS_SYNC;467467- *status |= FE_HAS_LOCK;468468- }469469- return 0;470470-}471471-472472-static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber)473473-{474474- struct nxt2002_state* state = fe->demodulator_priv;475475- u8 b[3];476476-477477- nxt2002_readreg_multibyte(state,0xE6,b,3);478478-479479- *ber = ((b[0] << 8) + b[1]) * 8;480480-481481- return 0;482482-}483483-484484-static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength)485485-{486486- struct nxt2002_state* state = fe->demodulator_priv;487487- u8 b[2];488488- u16 temp = 0;489489-490490- /* setup to read cluster variance */491491- b[0] = 0x00;492492- i2c_writebytes(state,0xA1,b,1);493493-494494- /* get multreg val */495495- nxt2002_readreg_multibyte(state,0xA6,b,2);496496-497497- temp = (b[0] << 8) | b[1];498498- *strength = ((0x7FFF - temp) & 0x0FFF) * 16;499499-500500- return 0;501501-}502502-503503-static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr)504504-{505505-506506- struct nxt2002_state* state = fe->demodulator_priv;507507- u8 b[2];508508- u16 temp = 0, temp2;509509- u32 snrdb = 0;510510-511511- /* setup to read cluster variance */512512- b[0] = 0x00;513513- i2c_writebytes(state,0xA1,b,1);514514-515515- /* get multreg val from 0xA6 */516516- nxt2002_readreg_multibyte(state,0xA6,b,2);517517-518518- temp = (b[0] << 8) | b[1];519519- temp2 = 0x7FFF - temp;520520-521521- /* snr will be in db */522522- if (temp2 > 0x7F00)523523- snrdb = 1000*24 + ( 1000*(30-24) * ( temp2 - 0x7F00 ) / ( 0x7FFF - 0x7F00 ) );524524- else if (temp2 > 0x7EC0)525525- snrdb = 1000*18 + ( 1000*(24-18) * ( temp2 - 0x7EC0 ) / ( 0x7F00 - 0x7EC0 ) );526526- else if (temp2 > 0x7C00)527527- snrdb = 1000*12 + ( 1000*(18-12) * ( temp2 - 0x7C00 ) / ( 0x7EC0 - 0x7C00 ) );528528- else529529- snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) );530530-531531- /* the value reported back from the frontend will be FFFF=32db 0000=0db */532532-533533- *snr = snrdb * (0xFFFF/32000);534534-535535- return 0;536536-}537537-538538-static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)539539-{540540- struct nxt2002_state* state = fe->demodulator_priv;541541- u8 b[3];542542-543543- nxt2002_readreg_multibyte(state,0xE6,b,3);544544- *ucblocks = b[2];545545-546546- return 0;547547-}548548-549549-static int nxt2002_sleep(struct dvb_frontend* fe)550550-{551551- return 0;552552-}553553-554554-static int nxt2002_init(struct dvb_frontend* fe)555555-{556556- struct nxt2002_state* state = fe->demodulator_priv;557557- const struct firmware *fw;558558- int ret;559559- u8 buf[2];560560-561561- if (!state->initialised) {562562- /* request the firmware, this will block until someone uploads it */563563- printk("nxt2002: Waiting for firmware upload (%s)...\n", NXT2002_DEFAULT_FIRMWARE);564564- ret = state->config->request_firmware(fe, &fw, NXT2002_DEFAULT_FIRMWARE);565565- printk("nxt2002: Waiting for firmware upload(2)...\n");566566- if (ret) {567567- printk("nxt2002: no firmware upload (timeout or file not found?)\n");568568- return ret;569569- }570570-571571- ret = nxt2002_load_firmware(fe, fw);572572- if (ret) {573573- printk("nxt2002: writing firmware to device failed\n");574574- release_firmware(fw);575575- return ret;576576- }577577- printk("nxt2002: firmware upload complete\n");578578-579579- /* Put the micro into reset */580580- nxt2002_microcontroller_stop(state);581581-582582- /* ensure transfer is complete */583583- buf[0]=0;584584- i2c_writebytes(state,0x2B,buf,1);585585-586586- /* Put the micro into reset for real this time */587587- nxt2002_microcontroller_stop(state);588588-589589- /* soft reset everything (agc,frontend,eq,fec)*/590590- buf[0] = 0x0F;591591- i2c_writebytes(state,0x08,buf,1);592592- buf[0] = 0x00;593593- i2c_writebytes(state,0x08,buf,1);594594-595595- /* write agc sdm configure */596596- buf[0] = 0xF1;597597- i2c_writebytes(state,0x57,buf,1);598598-599599- /* write mod output format */600600- buf[0] = 0x20;601601- i2c_writebytes(state,0x09,buf,1);602602-603603- /* write fec mpeg mode */604604- buf[0] = 0x7E;605605- buf[1] = 0x00;606606- i2c_writebytes(state,0xE9,buf,2);607607-608608- /* write mux selection */609609- buf[0] = 0x00;610610- i2c_writebytes(state,0xCC,buf,1);611611-612612- state->initialised = 1;613613- }614614-615615- return 0;616616-}617617-618618-static int nxt2002_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)619619-{620620- fesettings->min_delay_ms = 500;621621- fesettings->step_size = 0;622622- fesettings->max_drift = 0;623623- return 0;624624-}625625-626626-static void nxt2002_release(struct dvb_frontend* fe)627627-{628628- struct nxt2002_state* state = fe->demodulator_priv;629629- kfree(state);630630-}631631-632632-static struct dvb_frontend_ops nxt2002_ops;633633-634634-struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config,635635- struct i2c_adapter* i2c)636636-{637637- struct nxt2002_state* state = NULL;638638- u8 buf [] = {0,0,0,0,0};639639-640640- /* allocate memory for the internal state */641641- state = kmalloc(sizeof(struct nxt2002_state), GFP_KERNEL);642642- if (state == NULL) goto error;643643-644644- /* setup the state */645645- state->config = config;646646- state->i2c = i2c;647647- memcpy(&state->ops, &nxt2002_ops, sizeof(struct dvb_frontend_ops));648648- state->initialised = 0;649649-650650- /* Check the first 5 registers to ensure this a revision we can handle */651651-652652- i2c_readbytes(state, 0x00, buf, 5);653653- if (buf[0] != 0x04) goto error; /* device id */654654- if (buf[1] != 0x02) goto error; /* fab id */655655- if (buf[2] != 0x11) goto error; /* month */656656- if (buf[3] != 0x20) goto error; /* year msb */657657- if (buf[4] != 0x00) goto error; /* year lsb */658658-659659- /* create dvb_frontend */660660- state->frontend.ops = &state->ops;661661- state->frontend.demodulator_priv = state;662662- return &state->frontend;663663-664664-error:665665- kfree(state);666666- return NULL;667667-}668668-669669-static struct dvb_frontend_ops nxt2002_ops = {670670-671671- .info = {672672- .name = "Nextwave nxt2002 VSB/QAM frontend",673673- .type = FE_ATSC,674674- .frequency_min = 54000000,675675- .frequency_max = 860000000,676676- /* stepsize is just a guess */677677- .frequency_stepsize = 166666,678678- .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |679679- FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |680680- FE_CAN_8VSB | FE_CAN_QAM_64 | FE_CAN_QAM_256681681- },682682-683683- .release = nxt2002_release,684684-685685- .init = nxt2002_init,686686- .sleep = nxt2002_sleep,687687-688688- .set_frontend = nxt2002_setup_frontend_parameters,689689- .get_tune_settings = nxt2002_get_tune_settings,690690-691691- .read_status = nxt2002_read_status,692692- .read_ber = nxt2002_read_ber,693693- .read_signal_strength = nxt2002_read_signal_strength,694694- .read_snr = nxt2002_read_snr,695695- .read_ucblocks = nxt2002_read_ucblocks,696696-697697-};698698-699699-module_param(debug, int, 0644);700700-MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");701701-702702-MODULE_DESCRIPTION("NXT2002 ATSC (8VSB & ITU J83 AnnexB FEC QAM64/256) demodulator driver");703703-MODULE_AUTHOR("Taylor Jacob");704704-MODULE_LICENSE("GPL");705705-706706-EXPORT_SYMBOL(nxt2002_attach);
-23
drivers/media/dvb/frontends/nxt2002.h
···11-/*22- Driver for the Nxt2002 demodulator33-*/44-55-#ifndef NXT2002_H66-#define NXT2002_H77-88-#include <linux/dvb/frontend.h>99-#include <linux/firmware.h>1010-1111-struct nxt2002_config1212-{1313- /* the demodulator's i2c address */1414- u8 demod_address;1515-1616- /* request firmware for device */1717- int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);1818-};1919-2020-extern struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config,2121- struct i2c_adapter* i2c);2222-2323-#endif // NXT2002_H
+50-8
drivers/media/dvb/frontends/nxt200x.c
···11/*22 * Support for NXT2002 and NXT2004 - VSB/QAM33 *44- * Copyright (C) 2005 Kirk Lapray (kirk.lapray@gmail.com)44+ * Copyright (C) 2005 Kirk Lapray <kirk.lapray@gmail.com>55+ * Copyright (C) 2006 Michael Krufky <mkrufky@m1k.net>56 * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net>66- * and nxt2004 by Jean-Francois Thibert (jeanfrancois@sagetv.com)77+ * and nxt2004 by Jean-Francois Thibert <jeanfrancois@sagetv.com>78 *89 * This program is free software; you can redistribute it and/or modify910 * it under the terms of the GNU General Public License as published by···615614 /* write sdm1 input */616615 buf[0] = 0x10;617616 buf[1] = 0x00;618618- nxt200x_writebytes(state, 0x58, buf, 2);617617+ switch (state->demod_chip) {618618+ case NXT2002:619619+ nxt200x_writereg_multibyte(state, 0x58, buf, 2);620620+ break;621621+ case NXT2004:622622+ nxt200x_writebytes(state, 0x58, buf, 2);623623+ break;624624+ default:625625+ return -EINVAL;626626+ break;627627+ }619628620629 /* write sdmx input */621630 switch (p->u.vsb.modulation) {···643632 break;644633 }645634 buf[1] = 0x00;646646- nxt200x_writebytes(state, 0x5C, buf, 2);635635+ switch (state->demod_chip) {636636+ case NXT2002:637637+ nxt200x_writereg_multibyte(state, 0x5C, buf, 2);638638+ break;639639+ case NXT2004:640640+ nxt200x_writebytes(state, 0x5C, buf, 2);641641+ break;642642+ default:643643+ return -EINVAL;644644+ break;645645+ }647646648647 /* write adc power lpf fc */649648 buf[0] = 0x05;···669648 /* write accumulator2 input */670649 buf[0] = 0x80;671650 buf[1] = 0x00;672672- nxt200x_writebytes(state, 0x4B, buf, 2);651651+ switch (state->demod_chip) {652652+ case NXT2002:653653+ nxt200x_writereg_multibyte(state, 0x4B, buf, 2);654654+ break;655655+ case NXT2004:656656+ nxt200x_writebytes(state, 0x4B, buf, 2);657657+ break;658658+ default:659659+ return -EINVAL;660660+ break;661661+ }673662674663 /* write kg1 */675664 buf[0] = 0x00;···745714 /* write accumulator2 input */746715 buf[0] = 0x80;747716 buf[1] = 0x00;748748- nxt200x_writebytes(state, 0x49, buf,2);749749- nxt200x_writebytes(state, 0x4B, buf,2);717717+ switch (state->demod_chip) {718718+ case NXT2002:719719+ nxt200x_writereg_multibyte(state, 0x49, buf, 2);720720+ nxt200x_writereg_multibyte(state, 0x4B, buf, 2);721721+ break;722722+ case NXT2004:723723+ nxt200x_writebytes(state, 0x49, buf, 2);724724+ nxt200x_writebytes(state, 0x4B, buf, 2);725725+ break;726726+ default:727727+ return -EINVAL;728728+ break;729729+ }750730751731 /* write agc control reg */752732 buf[0] = 0x04;···12411199MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");1242120012431201MODULE_DESCRIPTION("NXT200X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver");12441244-MODULE_AUTHOR("Kirk Lapray, Jean-Francois Thibert, and Taylor Jacob");12021202+MODULE_AUTHOR("Kirk Lapray, Michael Krufky, Jean-Francois Thibert, and Taylor Jacob");12451203MODULE_LICENSE("GPL");1246120412471205EXPORT_SYMBOL(nxt200x_attach);
-734
drivers/media/dvb/frontends/tda80xx.c
···11-/*22- * tda80xx.c33- *44- * Philips TDA8044 / TDA8083 QPSK demodulator driver55- *66- * Copyright (C) 2001 Felix Domke <tmbinc@elitedvb.net>77- * Copyright (C) 2002-2004 Andreas Oberritter <obi@linuxtv.org>88- *99- * This program is free software; you can redistribute it and/or modify1010- * it under the terms of the GNU General Public License as published by1111- * the Free Software Foundation; either version 2 of the License, or1212- * (at your option) any later version.1313- *1414- * This program is distributed in the hope that it will be useful,1515- * but WITHOUT ANY WARRANTY; without even the implied warranty of1616- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1717- * GNU General Public License for more details.1818- *1919- * You should have received a copy of the GNU General Public License2020- * along with this program; if not, write to the Free Software2121- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2222- */2323-2424-#include <linux/config.h>2525-#include <linux/delay.h>2626-#include <linux/init.h>2727-#include <linux/spinlock.h>2828-#include <linux/threads.h>2929-#include <linux/interrupt.h>3030-#include <linux/kernel.h>3131-#include <linux/module.h>3232-#include <linux/slab.h>3333-#include <asm/irq.h>3434-#include <asm/div64.h>3535-3636-#include "dvb_frontend.h"3737-#include "tda80xx.h"3838-3939-enum {4040- ID_TDA8044 = 0x04,4141- ID_TDA8083 = 0x05,4242-};4343-4444-4545-struct tda80xx_state {4646-4747- struct i2c_adapter* i2c;4848-4949- struct dvb_frontend_ops ops;5050-5151- /* configuration settings */5252- const struct tda80xx_config* config;5353-5454- struct dvb_frontend frontend;5555-5656- u32 clk;5757- int afc_loop;5858- struct work_struct worklet;5959- fe_code_rate_t code_rate;6060- fe_spectral_inversion_t spectral_inversion;6161- fe_status_t status;6262- u8 id;6363-};6464-6565-static int debug = 1;6666-#define dprintk if (debug) printk6767-6868-static u8 tda8044_inittab_pre[] = {6969- 0x02, 0x00, 0x6f, 0xb5, 0x86, 0x22, 0x00, 0xea,7070- 0x30, 0x42, 0x98, 0x68, 0x70, 0x42, 0x99, 0x58,7171- 0x95, 0x10, 0xf5, 0xe7, 0x93, 0x0b, 0x15, 0x68,7272- 0x9a, 0x90, 0x61, 0x80, 0x00, 0xe0, 0x40, 0x00,7373- 0x0f, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,7474- 0x00, 0x007575-};7676-7777-static u8 tda8044_inittab_post[] = {7878- 0x04, 0x00, 0x6f, 0xb5, 0x86, 0x22, 0x00, 0xea,7979- 0x30, 0x42, 0x98, 0x68, 0x70, 0x42, 0x99, 0x50,8080- 0x95, 0x10, 0xf5, 0xe7, 0x93, 0x0b, 0x15, 0x68,8181- 0x9a, 0x90, 0x61, 0x80, 0x00, 0xe0, 0x40, 0x6c,8282- 0x0f, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,8383- 0x00, 0x008484-};8585-8686-static u8 tda8083_inittab[] = {8787- 0x04, 0x00, 0x4a, 0x79, 0x04, 0x00, 0xff, 0xea,8888- 0x48, 0x42, 0x79, 0x60, 0x70, 0x52, 0x9a, 0x10,8989- 0x0e, 0x10, 0xf2, 0xa7, 0x93, 0x0b, 0x05, 0xc8,9090- 0x9d, 0x00, 0x42, 0x80, 0x00, 0x60, 0x40, 0x00,9191- 0x00, 0x75, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00,9292- 0x00, 0x00, 0x00, 0x009393-};9494-9595-static __inline__ u32 tda80xx_div(u32 a, u32 b)9696-{9797- return (a + (b / 2)) / b;9898-}9999-100100-static __inline__ u32 tda80xx_gcd(u32 a, u32 b)101101-{102102- u32 r;103103-104104- while ((r = a % b)) {105105- a = b;106106- b = r;107107- }108108-109109- return b;110110-}111111-112112-static int tda80xx_read(struct tda80xx_state* state, u8 reg, u8 *buf, u8 len)113113-{114114- int ret;115115- struct i2c_msg msg[] = { { .addr = state->config->demod_address, .flags = 0, .buf = ®, .len = 1 },116116- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } };117117-118118- ret = i2c_transfer(state->i2c, msg, 2);119119-120120- if (ret != 2)121121- dprintk("%s: readreg error (reg %02x, ret == %i)\n",122122- __FUNCTION__, reg, ret);123123-124124- mdelay(10);125125-126126- return (ret == 2) ? 0 : -EREMOTEIO;127127-}128128-129129-static int tda80xx_write(struct tda80xx_state* state, u8 reg, const u8 *buf, u8 len)130130-{131131- int ret;132132- u8 wbuf[len + 1];133133- struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = wbuf, .len = len + 1 };134134-135135- wbuf[0] = reg;136136- memcpy(&wbuf[1], buf, len);137137-138138- ret = i2c_transfer(state->i2c, &msg, 1);139139-140140- if (ret != 1)141141- dprintk("%s: i2c xfer error (ret == %i)\n", __FUNCTION__, ret);142142-143143- mdelay(10);144144-145145- return (ret == 1) ? 0 : -EREMOTEIO;146146-}147147-148148-static __inline__ u8 tda80xx_readreg(struct tda80xx_state* state, u8 reg)149149-{150150- u8 val;151151-152152- tda80xx_read(state, reg, &val, 1);153153-154154- return val;155155-}156156-157157-static __inline__ int tda80xx_writereg(struct tda80xx_state* state, u8 reg, u8 data)158158-{159159- return tda80xx_write(state, reg, &data, 1);160160-}161161-162162-static int tda80xx_set_parameters(struct tda80xx_state* state,163163- fe_spectral_inversion_t inversion,164164- u32 symbol_rate,165165- fe_code_rate_t fec_inner)166166-{167167- u8 buf[15];168168- u64 ratio;169169- u32 clk;170170- u32 k;171171- u32 sr = symbol_rate;172172- u32 gcd;173173- u8 scd;174174-175175- if (symbol_rate > (state->clk * 3) / 16)176176- scd = 0;177177- else if (symbol_rate > (state->clk * 3) / 32)178178- scd = 1;179179- else if (symbol_rate > (state->clk * 3) / 64)180180- scd = 2;181181- else182182- scd = 3;183183-184184- clk = scd ? (state->clk / (scd * 2)) : state->clk;185185-186186- /*187187- * Viterbi decoder:188188- * Differential decoding off189189- * Spectral inversion unknown190190- * QPSK modulation191191- */192192- if (inversion == INVERSION_ON)193193- buf[0] = 0x60;194194- else if (inversion == INVERSION_OFF)195195- buf[0] = 0x20;196196- else197197- buf[0] = 0x00;198198-199199- /*200200- * CLK ratio:201201- * system clock frequency is up to 64 or 96 MHz202202- *203203- * formula:204204- * r = k * clk / symbol_rate205205- *206206- * k: 2^21 for caa 0..3,207207- * 2^20 for caa 4..5,208208- * 2^19 for caa 6..7209209- */210210- if (symbol_rate <= (clk * 3) / 32)211211- k = (1 << 19);212212- else if (symbol_rate <= (clk * 3) / 16)213213- k = (1 << 20);214214- else215215- k = (1 << 21);216216-217217- gcd = tda80xx_gcd(clk, sr);218218- clk /= gcd;219219- sr /= gcd;220220-221221- gcd = tda80xx_gcd(k, sr);222222- k /= gcd;223223- sr /= gcd;224224-225225- ratio = (u64)k * (u64)clk;226226- do_div(ratio, sr);227227-228228- buf[1] = ratio >> 16;229229- buf[2] = ratio >> 8;230230- buf[3] = ratio;231231-232232- /* nyquist filter roll-off factor 35% */233233- buf[4] = 0x20;234234-235235- clk = scd ? (state->clk / (scd * 2)) : state->clk;236236-237237- /* Anti Alias Filter */238238- if (symbol_rate < (clk * 3) / 64)239239- printk("tda80xx: unsupported symbol rate: %u\n", symbol_rate);240240- else if (symbol_rate <= clk / 16)241241- buf[4] |= 0x07;242242- else if (symbol_rate <= (clk * 3) / 32)243243- buf[4] |= 0x06;244244- else if (symbol_rate <= clk / 8)245245- buf[4] |= 0x05;246246- else if (symbol_rate <= (clk * 3) / 16)247247- buf[4] |= 0x04;248248- else if (symbol_rate <= clk / 4)249249- buf[4] |= 0x03;250250- else if (symbol_rate <= (clk * 3) / 8)251251- buf[4] |= 0x02;252252- else if (symbol_rate <= clk / 2)253253- buf[4] |= 0x01;254254- else255255- buf[4] |= 0x00;256256-257257- /* Sigma Delta converter */258258- buf[5] = 0x00;259259-260260- /* FEC: Possible puncturing rates */261261- if (fec_inner == FEC_NONE)262262- buf[6] = 0x00;263263- else if ((fec_inner >= FEC_1_2) && (fec_inner <= FEC_8_9))264264- buf[6] = (1 << (8 - fec_inner));265265- else if (fec_inner == FEC_AUTO)266266- buf[6] = 0xff;267267- else268268- return -EINVAL;269269-270270- /* carrier lock detector threshold value */271271- buf[7] = 0x30;272272- /* AFC1: proportional part settings */273273- buf[8] = 0x42;274274- /* AFC1: integral part settings */275275- buf[9] = 0x98;276276- /* PD: Leaky integrator SCPC mode */277277- buf[10] = 0x28;278278- /* AFC2, AFC1 controls */279279- buf[11] = 0x30;280280- /* PD: proportional part settings */281281- buf[12] = 0x42;282282- /* PD: integral part settings */283283- buf[13] = 0x99;284284- /* AGC */285285- buf[14] = 0x50 | scd;286286-287287- printk("symbol_rate=%u clk=%u\n", symbol_rate, clk);288288-289289- return tda80xx_write(state, 0x01, buf, sizeof(buf));290290-}291291-292292-static int tda80xx_set_clk(struct tda80xx_state* state)293293-{294294- u8 buf[2];295295-296296- /* CLK proportional part */297297- buf[0] = (0x06 << 5) | 0x08; /* CMP[2:0], CSP[4:0] */298298- /* CLK integral part */299299- buf[1] = (0x04 << 5) | 0x1a; /* CMI[2:0], CSI[4:0] */300300-301301- return tda80xx_write(state, 0x17, buf, sizeof(buf));302302-}303303-304304-#if 0305305-static int tda80xx_set_scpc_freq_offset(struct tda80xx_state* state)306306-{307307- /* a constant value is nonsense here imho */308308- return tda80xx_writereg(state, 0x22, 0xf9);309309-}310310-#endif311311-312312-static int tda80xx_close_loop(struct tda80xx_state* state)313313-{314314- u8 buf[2];315315-316316- /* PD: Loop closed, LD: lock detect enable, SCPC: Sweep mode - AFC1 loop closed */317317- buf[0] = 0x68;318318- /* AFC1: Loop closed, CAR Feedback: 8192 */319319- buf[1] = 0x70;320320-321321- return tda80xx_write(state, 0x0b, buf, sizeof(buf));322322-}323323-324324-static irqreturn_t tda80xx_irq(int irq, void *priv, struct pt_regs *pt)325325-{326326- schedule_work(priv);327327-328328- return IRQ_HANDLED;329329-}330330-331331-static void tda80xx_read_status_int(struct tda80xx_state* state)332332-{333333- u8 val;334334-335335- static const fe_spectral_inversion_t inv_tab[] = {336336- INVERSION_OFF, INVERSION_ON337337- };338338-339339- static const fe_code_rate_t fec_tab[] = {340340- FEC_8_9, FEC_1_2, FEC_2_3, FEC_3_4,341341- FEC_4_5, FEC_5_6, FEC_6_7, FEC_7_8,342342- };343343-344344- val = tda80xx_readreg(state, 0x02);345345-346346- state->status = 0;347347-348348- if (val & 0x01) /* demodulator lock */349349- state->status |= FE_HAS_SIGNAL;350350- if (val & 0x02) /* clock recovery lock */351351- state->status |= FE_HAS_CARRIER;352352- if (val & 0x04) /* viterbi lock */353353- state->status |= FE_HAS_VITERBI;354354- if (val & 0x08) /* deinterleaver lock (packet sync) */355355- state->status |= FE_HAS_SYNC;356356- if (val & 0x10) /* derandomizer lock (frame sync) */357357- state->status |= FE_HAS_LOCK;358358- if (val & 0x20) /* frontend can not lock */359359- state->status |= FE_TIMEDOUT;360360-361361- if ((state->status & (FE_HAS_CARRIER)) && (state->afc_loop)) {362362- printk("tda80xx: closing loop\n");363363- tda80xx_close_loop(state);364364- state->afc_loop = 0;365365- }366366-367367- if (state->status & (FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK)) {368368- val = tda80xx_readreg(state, 0x0e);369369- state->code_rate = fec_tab[val & 0x07];370370- if (state->status & (FE_HAS_SYNC | FE_HAS_LOCK))371371- state->spectral_inversion = inv_tab[(val >> 7) & 0x01];372372- else373373- state->spectral_inversion = INVERSION_AUTO;374374- }375375- else {376376- state->code_rate = FEC_AUTO;377377- }378378-}379379-380380-static void tda80xx_worklet(void *priv)381381-{382382- struct tda80xx_state *state = priv;383383-384384- tda80xx_writereg(state, 0x00, 0x04);385385- enable_irq(state->config->irq);386386-387387- tda80xx_read_status_int(state);388388-}389389-390390-static void tda80xx_wait_diseqc_fifo(struct tda80xx_state* state)391391-{392392- size_t i;393393-394394- for (i = 0; i < 100; i++) {395395- if (tda80xx_readreg(state, 0x02) & 0x80)396396- break;397397- msleep(10);398398- }399399-}400400-401401-static int tda8044_init(struct dvb_frontend* fe)402402-{403403- struct tda80xx_state* state = fe->demodulator_priv;404404- int ret;405405-406406- /*407407- * this function is a mess...408408- */409409-410410- if ((ret = tda80xx_write(state, 0x00, tda8044_inittab_pre, sizeof(tda8044_inittab_pre))))411411- return ret;412412-413413- tda80xx_writereg(state, 0x0f, 0x50);414414-#if 1415415- tda80xx_writereg(state, 0x20, 0x8F); /* FIXME */416416- tda80xx_writereg(state, 0x20, state->config->volt18setting); /* FIXME */417417- //tda80xx_writereg(state, 0x00, 0x04);418418- tda80xx_writereg(state, 0x00, 0x0C);419419-#endif420420- //tda80xx_writereg(state, 0x00, 0x08); /* Reset AFC1 loop filter */421421-422422- tda80xx_write(state, 0x00, tda8044_inittab_post, sizeof(tda8044_inittab_post));423423-424424- if (state->config->pll_init) {425425- tda80xx_writereg(state, 0x1c, 0x80);426426- state->config->pll_init(fe);427427- tda80xx_writereg(state, 0x1c, 0x00);428428- }429429-430430- return 0;431431-}432432-433433-static int tda8083_init(struct dvb_frontend* fe)434434-{435435- struct tda80xx_state* state = fe->demodulator_priv;436436-437437- tda80xx_write(state, 0x00, tda8083_inittab, sizeof(tda8083_inittab));438438-439439- if (state->config->pll_init) {440440- tda80xx_writereg(state, 0x1c, 0x80);441441- state->config->pll_init(fe);442442- tda80xx_writereg(state, 0x1c, 0x00);443443- }444444-445445- return 0;446446-}447447-448448-static int tda80xx_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)449449-{450450- struct tda80xx_state* state = fe->demodulator_priv;451451-452452- switch (voltage) {453453- case SEC_VOLTAGE_13:454454- return tda80xx_writereg(state, 0x20, state->config->volt13setting);455455- case SEC_VOLTAGE_18:456456- return tda80xx_writereg(state, 0x20, state->config->volt18setting);457457- case SEC_VOLTAGE_OFF:458458- return tda80xx_writereg(state, 0x20, 0);459459- default:460460- return -EINVAL;461461- }462462-}463463-464464-static int tda80xx_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)465465-{466466- struct tda80xx_state* state = fe->demodulator_priv;467467-468468- switch (tone) {469469- case SEC_TONE_OFF:470470- return tda80xx_writereg(state, 0x29, 0x00);471471- case SEC_TONE_ON:472472- return tda80xx_writereg(state, 0x29, 0x80);473473- default:474474- return -EINVAL;475475- }476476-}477477-478478-static int tda80xx_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd)479479-{480480- struct tda80xx_state* state = fe->demodulator_priv;481481-482482- if (cmd->msg_len > 6)483483- return -EINVAL;484484-485485- tda80xx_writereg(state, 0x29, 0x08 | (cmd->msg_len - 3));486486- tda80xx_write(state, 0x23, cmd->msg, cmd->msg_len);487487- tda80xx_writereg(state, 0x29, 0x0c | (cmd->msg_len - 3));488488- tda80xx_wait_diseqc_fifo(state);489489-490490- return 0;491491-}492492-493493-static int tda80xx_send_diseqc_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t cmd)494494-{495495- struct tda80xx_state* state = fe->demodulator_priv;496496-497497- switch (cmd) {498498- case SEC_MINI_A:499499- tda80xx_writereg(state, 0x29, 0x14);500500- break;501501- case SEC_MINI_B:502502- tda80xx_writereg(state, 0x29, 0x1c);503503- break;504504- default:505505- return -EINVAL;506506- }507507-508508- tda80xx_wait_diseqc_fifo(state);509509-510510- return 0;511511-}512512-513513-static int tda80xx_sleep(struct dvb_frontend* fe)514514-{515515- struct tda80xx_state* state = fe->demodulator_priv;516516-517517- tda80xx_writereg(state, 0x00, 0x02); /* enter standby */518518-519519- return 0;520520-}521521-522522-static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)523523-{524524- struct tda80xx_state* state = fe->demodulator_priv;525525-526526- tda80xx_writereg(state, 0x1c, 0x80);527527- state->config->pll_set(fe, p);528528- tda80xx_writereg(state, 0x1c, 0x00);529529-530530- tda80xx_set_parameters(state, p->inversion, p->u.qpsk.symbol_rate, p->u.qpsk.fec_inner);531531- tda80xx_set_clk(state);532532- //tda80xx_set_scpc_freq_offset(state);533533- state->afc_loop = 1;534534-535535- return 0;536536-}537537-538538-static int tda80xx_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)539539-{540540- struct tda80xx_state* state = fe->demodulator_priv;541541-542542- if (!state->config->irq)543543- tda80xx_read_status_int(state);544544-545545- p->inversion = state->spectral_inversion;546546- p->u.qpsk.fec_inner = state->code_rate;547547-548548- return 0;549549-}550550-551551-static int tda80xx_read_status(struct dvb_frontend* fe, fe_status_t* status)552552-{553553- struct tda80xx_state* state = fe->demodulator_priv;554554-555555- if (!state->config->irq)556556- tda80xx_read_status_int(state);557557- *status = state->status;558558-559559- return 0;560560-}561561-562562-static int tda80xx_read_ber(struct dvb_frontend* fe, u32* ber)563563-{564564- struct tda80xx_state* state = fe->demodulator_priv;565565- int ret;566566- u8 buf[3];567567-568568- if ((ret = tda80xx_read(state, 0x0b, buf, sizeof(buf))))569569- return ret;570570-571571- *ber = ((buf[0] & 0x1f) << 16) | (buf[1] << 8) | buf[2];572572-573573- return 0;574574-}575575-576576-static int tda80xx_read_signal_strength(struct dvb_frontend* fe, u16* strength)577577-{578578- struct tda80xx_state* state = fe->demodulator_priv;579579-580580- u8 gain = ~tda80xx_readreg(state, 0x01);581581- *strength = (gain << 8) | gain;582582-583583- return 0;584584-}585585-586586-static int tda80xx_read_snr(struct dvb_frontend* fe, u16* snr)587587-{588588- struct tda80xx_state* state = fe->demodulator_priv;589589-590590- u8 quality = tda80xx_readreg(state, 0x08);591591- *snr = (quality << 8) | quality;592592-593593- return 0;594594-}595595-596596-static int tda80xx_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)597597-{598598- struct tda80xx_state* state = fe->demodulator_priv;599599-600600- *ucblocks = tda80xx_readreg(state, 0x0f);601601- if (*ucblocks == 0xff)602602- *ucblocks = 0xffffffff;603603-604604- return 0;605605-}606606-607607-static int tda80xx_init(struct dvb_frontend* fe)608608-{609609- struct tda80xx_state* state = fe->demodulator_priv;610610-611611- switch(state->id) {612612- case ID_TDA8044:613613- return tda8044_init(fe);614614-615615- case ID_TDA8083:616616- return tda8083_init(fe);617617- }618618- return 0;619619-}620620-621621-static void tda80xx_release(struct dvb_frontend* fe)622622-{623623- struct tda80xx_state* state = fe->demodulator_priv;624624-625625- if (state->config->irq)626626- free_irq(state->config->irq, &state->worklet);627627-628628- kfree(state);629629-}630630-631631-static struct dvb_frontend_ops tda80xx_ops;632632-633633-struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config,634634- struct i2c_adapter* i2c)635635-{636636- struct tda80xx_state* state = NULL;637637- int ret;638638-639639- /* allocate memory for the internal state */640640- state = kmalloc(sizeof(struct tda80xx_state), GFP_KERNEL);641641- if (state == NULL) goto error;642642-643643- /* setup the state */644644- state->config = config;645645- state->i2c = i2c;646646- memcpy(&state->ops, &tda80xx_ops, sizeof(struct dvb_frontend_ops));647647- state->spectral_inversion = INVERSION_AUTO;648648- state->code_rate = FEC_AUTO;649649- state->status = 0;650650- state->afc_loop = 0;651651-652652- /* check if the demod is there */653653- if (tda80xx_writereg(state, 0x89, 0x00) < 0) goto error;654654- state->id = tda80xx_readreg(state, 0x00);655655-656656- switch (state->id) {657657- case ID_TDA8044:658658- state->clk = 96000000;659659- printk("tda80xx: Detected tda8044\n");660660- break;661661-662662- case ID_TDA8083:663663- state->clk = 64000000;664664- printk("tda80xx: Detected tda8083\n");665665- break;666666-667667- default:668668- goto error;669669- }670670-671671- /* setup IRQ */672672- if (state->config->irq) {673673- INIT_WORK(&state->worklet, tda80xx_worklet, state);674674- if ((ret = request_irq(state->config->irq, tda80xx_irq, SA_ONESHOT, "tda80xx", &state->worklet)) < 0) {675675- printk(KERN_ERR "tda80xx: request_irq failed (%d)\n", ret);676676- goto error;677677- }678678- }679679-680680- /* create dvb_frontend */681681- state->frontend.ops = &state->ops;682682- state->frontend.demodulator_priv = state;683683- return &state->frontend;684684-685685-error:686686- kfree(state);687687- return NULL;688688-}689689-690690-static struct dvb_frontend_ops tda80xx_ops = {691691-692692- .info = {693693- .name = "Philips TDA80xx DVB-S",694694- .type = FE_QPSK,695695- .frequency_min = 500000,696696- .frequency_max = 2700000,697697- .frequency_stepsize = 125,698698- .symbol_rate_min = 4500000,699699- .symbol_rate_max = 45000000,700700- .caps = FE_CAN_INVERSION_AUTO |701701- FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |702702- FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |703703- FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |704704- FE_CAN_QPSK |705705- FE_CAN_MUTE_TS706706- },707707-708708- .release = tda80xx_release,709709-710710- .init = tda80xx_init,711711- .sleep = tda80xx_sleep,712712-713713- .set_frontend = tda80xx_set_frontend,714714- .get_frontend = tda80xx_get_frontend,715715-716716- .read_status = tda80xx_read_status,717717- .read_ber = tda80xx_read_ber,718718- .read_signal_strength = tda80xx_read_signal_strength,719719- .read_snr = tda80xx_read_snr,720720- .read_ucblocks = tda80xx_read_ucblocks,721721-722722- .diseqc_send_master_cmd = tda80xx_send_diseqc_msg,723723- .diseqc_send_burst = tda80xx_send_diseqc_burst,724724- .set_tone = tda80xx_set_tone,725725- .set_voltage = tda80xx_set_voltage,726726-};727727-728728-module_param(debug, int, 0644);729729-730730-MODULE_DESCRIPTION("Philips TDA8044 / TDA8083 DVB-S Demodulator driver");731731-MODULE_AUTHOR("Felix Domke, Andreas Oberritter");732732-MODULE_LICENSE("GPL");733733-734734-EXPORT_SYMBOL(tda80xx_attach);
-51
drivers/media/dvb/frontends/tda80xx.h
···11-/*22- * tda80xx.c33- *44- * Philips TDA8044 / TDA8083 QPSK demodulator driver55- *66- * Copyright (C) 2001 Felix Domke <tmbinc@elitedvb.net>77- * Copyright (C) 2002-2004 Andreas Oberritter <obi@linuxtv.org>88- *99- * This program is free software; you can redistribute it and/or modify1010- * it under the terms of the GNU General Public License as published by1111- * the Free Software Foundation; either version 2 of the License, or1212- * (at your option) any later version.1313- *1414- * This program is distributed in the hope that it will be useful,1515- * but WITHOUT ANY WARRANTY; without even the implied warranty of1616- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1717- * GNU General Public License for more details.1818- *1919- * You should have received a copy of the GNU General Public License2020- * along with this program; if not, write to the Free Software2121- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2222- */2323-2424-#ifndef TDA80XX_H2525-#define TDA80XX_H2626-2727-#include <linux/dvb/frontend.h>2828-2929-struct tda80xx_config3030-{3131- /* the demodulator's i2c address */3232- u8 demod_address;3333-3434- /* IRQ to use (0=>no IRQ used) */3535- u32 irq;3636-3737- /* Register setting to use for 13v */3838- u8 volt13setting;3939-4040- /* Register setting to use for 18v */4141- u8 volt18setting;4242-4343- /* PLL maintenance */4444- int (*pll_init)(struct dvb_frontend* fe);4545- int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);4646-};4747-4848-extern struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config,4949- struct i2c_adapter* i2c);5050-5151-#endif // TDA80XX_H
···273273extern int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,274274 u16 subpid, u16 pcrpid);275275276276-extern int av7110_setup_irc_config (struct av7110 *av7110, u32 ir_config);277277-278276extern int av7110_ir_init(struct av7110 *av7110);279277extern void av7110_ir_exit(struct av7110 *av7110);280278
+13-13
drivers/media/dvb/ttpci/av7110_ir.c
···155155}156156157157158158+static int av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config)159159+{160160+ int ret = 0;161161+162162+ dprintk(4, "%p\n", av7110);163163+ if (av7110) {164164+ ret = av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config);165165+ av7110->ir_config = ir_config;166166+ }167167+ return ret;168168+}169169+170170+158171static int av7110_ir_write_proc(struct file *file, const char __user *buffer,159172 unsigned long count, void *data)160173{···197184 av7110_setup_irc_config(av_list[i], ir_config);198185 input_register_keys();199186 return count;200200-}201201-202202-203203-int av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config)204204-{205205- int ret = 0;206206-207207- dprintk(4, "%p\n", av7110);208208- if (av7110) {209209- ret = av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config);210210- av7110->ir_config = ir_config;211211- }212212- return ret;213187}214188215189
+1-1
drivers/media/video/bttv-driver.c
···214214 we can capture, of the first and second field. */215215 .vbistart = { 7,320 },216216 },{217217- .v4l2_id = V4L2_STD_NTSC_M,217217+ .v4l2_id = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,218218 .name = "NTSC",219219 .Fsc = 28636363,220220 .swidth = 768,
+20-30
drivers/media/video/cx25840/cx25840-core.c
···220220 cx25840_write(client, 0x808, 0xff);221221 cx25840_write(client, 0x80b, 0x10);222222 } else if (std & V4L2_STD_NTSC) {223223- /* NTSC */224224- if (state->pvr150_workaround) {225225- /* Certain Hauppauge PVR150 models have a hardware bug226226- that causes audio to drop out. For these models the227227- audio standard must be set explicitly.228228- To be precise: it affects cards with tuner models229229- 85, 99 and 112 (model numbers from tveeprom). */230230- if (std == V4L2_STD_NTSC_M_JP) {231231- /* Japan uses EIAJ audio standard */232232- cx25840_write(client, 0x808, 0x2f);233233- } else {234234- /* Others use the BTSC audio standard */235235- cx25840_write(client, 0x808, 0x1f);236236- }237237- /* South Korea uses the A2-M (aka Zweiton M) audio238238- standard, and should set 0x808 to 0x3f, but I don't239239- know how to detect this. */240240- } else if (std == V4L2_STD_NTSC_M_JP) {223223+ /* Certain Hauppauge PVR150 models have a hardware bug224224+ that causes audio to drop out. For these models the225225+ audio standard must be set explicitly.226226+ To be precise: it affects cards with tuner models227227+ 85, 99 and 112 (model numbers from tveeprom). */228228+ int hw_fix = state->pvr150_workaround;229229+230230+ if (std == V4L2_STD_NTSC_M_JP) {241231 /* Japan uses EIAJ audio standard */242242- cx25840_write(client, 0x808, 0xf7);232232+ cx25840_write(client, 0x808, hw_fix ? 0x2f : 0xf7);233233+ } else if (std == V4L2_STD_NTSC_M_KR) {234234+ /* South Korea uses A2 audio standard */235235+ cx25840_write(client, 0x808, hw_fix ? 0x3f : 0xf8);243236 } else {244237 /* Others use the BTSC audio standard */245245- cx25840_write(client, 0x808, 0xf6);238238+ cx25840_write(client, 0x808, hw_fix ? 0x1f : 0xf6);246239 }247247- /* South Korea uses the A2-M (aka Zweiton M) audio standard,248248- and should set 0x808 to 0xf8, but I don't know how to249249- detect this. */250240 cx25840_write(client, 0x80b, 0x00);251241 }252242···320330 u8 fmt=0; /* zero is autodetect */321331322332 /* First tests should be against specific std */323323- if (std & V4L2_STD_NTSC_M_JP) {333333+ if (std == V4L2_STD_NTSC_M_JP) {324334 fmt=0x2;325325- } else if (std & V4L2_STD_NTSC_443) {335335+ } else if (std == V4L2_STD_NTSC_443) {326336 fmt=0x3;327327- } else if (std & V4L2_STD_PAL_M) {337337+ } else if (std == V4L2_STD_PAL_M) {328338 fmt=0x5;329329- } else if (std & V4L2_STD_PAL_N) {339339+ } else if (std == V4L2_STD_PAL_N) {330340 fmt=0x6;331331- } else if (std & V4L2_STD_PAL_Nc) {341341+ } else if (std == V4L2_STD_PAL_Nc) {332342 fmt=0x7;333333- } else if (std & V4L2_STD_PAL_60) {343343+ } else if (std == V4L2_STD_PAL_60) {334344 fmt=0x8;335345 } else {336346 /* Then, test against generic ones */···359369 }360370361371 switch (fmt) {362362- case 0x1: return V4L2_STD_NTSC_M;372372+ case 0x1: return V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR;363373 case 0x2: return V4L2_STD_NTSC_M_JP;364374 case 0x3: return V4L2_STD_NTSC_443;365375 case 0x4: return V4L2_STD_PAL;
+12
drivers/media/video/cx88/Kconfig
···3232config VIDEO_CX88_ALSA3333 tristate "ALSA DMA audio support"3434 depends on VIDEO_CX88 && SND && EXPERIMENTAL3535+ select SND_PCM3536 ---help---3637 This is a video4linux driver for direct (DMA) audio on3738 Conexant 2388x based TV cards.···4948 default y5049 depends on VIDEO_CX88_DVB5150 select DVB_MT3525151+ select VIDEO_CX88_VP30545252 select DVB_OR511325353 select DVB_CX227025454 select DVB_LGDT330X···7068 ---help---7169 This adds DVB-T support for cards based on the7270 Connexant 2388x chip and the MT352 demodulator.7171+7272+config VIDEO_CX88_VP30547373+ tristate "VP-3054 Secondary I2C Bus Support"7474+ default m7575+ depends on DVB_MT3527676+ ---help---7777+ This adds DVB-T support for cards based on the7878+ Connexant 2388x chip and the MT352 demodulator,7979+ which also require support for the VP-30548080+ Secondary I2C bus, such at DNTV Live! DVB-T Pro.73817482config VIDEO_CX88_DVB_OR511327583 bool "OR51132 ATSC Support"
···128128 * BOARD Specific: Sets audio DMA129129 */130130131131-int _cx88_start_audio_dma(snd_cx88_card_t *chip)131131+static int _cx88_start_audio_dma(snd_cx88_card_t *chip)132132{133133 struct cx88_buffer *buf = chip->buf;134134 struct cx88_core *core=chip->core;···173173/*174174 * BOARD Specific: Resets audio DMA175175 */176176-int _cx88_stop_audio_dma(snd_cx88_card_t *chip)176176+static int _cx88_stop_audio_dma(snd_cx88_card_t *chip)177177{178178 struct cx88_core *core=chip->core;179179 dprintk(1, "Stopping audio DMA\n");···613613 * Only boards with eeprom and byte 1 at eeprom=1 have it614614 */615615616616-struct pci_device_id cx88_audio_pci_tbl[] = {616616+static struct pci_device_id cx88_audio_pci_tbl[] = {617617 {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},618618 {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},619619 {0, }
+6
drivers/media/video/cx88/cx88-cards.c
···12461246 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,12471247 },{12481248 .subvendor = 0x18ac,12491249+ .subdevice = 0xdb54,12501250+ .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,12511251+ /* Re-branded DViCO: DigitalNow DVB-T Dual */12521252+ },{12531253+ .subvendor = 0x18ac,12491254 .subdevice = 0xdb11,12501255 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,12511256 /* Re-branded DViCO: UltraView DVB-T Plus */···12981293 switch (tv.model)12991294 {13001295 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */12961296+ case 34519: /* WinTV-PCI-FM */13011297 case 90002: /* Nova-T-PCI (9002) */13021298 case 92001: /* Nova-S-Plus (Video and IR) */13031299 case 92002: /* Nova-S-Plus (Video and IR) */
+6-4
drivers/media/video/cx88/cx88-core.c
···787787788788int cx88_start_audio_dma(struct cx88_core *core)789789{790790+ /* constant 128 made buzz in analog Nicam-stereo for bigger fifo_size */791791+ int bpl = cx88_sram_channels[SRAM_CH25].fifo_size/4;790792 /* setup fifo + format */791791- cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0);792792- cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0);793793+ cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], bpl, 0);794794+ cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], bpl, 0);793795794794- cx_write(MO_AUDD_LNGTH, 128); /* fifo bpl size */795795- cx_write(MO_AUDR_LNGTH, 128); /* fifo bpl size */796796+ cx_write(MO_AUDD_LNGTH, bpl); /* fifo bpl size */797797+ cx_write(MO_AUDR_LNGTH, bpl); /* fifo bpl size */796798797799 /* start dma */798800 cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */
+1
drivers/media/video/cx88/cx88-input.c
···482482 switch (core->board) {483483 case CX88_BOARD_DNTV_LIVE_DVB_T:484484 case CX88_BOARD_KWORLD_DVB_T:485485+ case CX88_BOARD_KWORLD_DVB_T_CX22702:485486 ir_codes = ir_codes_dntv_live_dvb_t;486487 ir->gpio_addr = MO_GP1_IO;487488 ir->mask_keycode = 0x1f;
+14-3
drivers/media/video/em28xx/em28xx-core.c
···139139{140140 int ret, byte;141141142142+ if (dev->state & DEV_DISCONNECTED)143143+ return(-ENODEV);144144+142145 em28xx_regdbg("req=%02x, reg=%02x ", req, reg);143146144147 ret = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), req,···167164{168165 u8 val;169166 int ret;167167+168168+ if (dev->state & DEV_DISCONNECTED)169169+ return(-ENODEV);170170171171 em28xx_regdbg("req=%02x, reg=%02x:", req, reg);172172···201195 int ret;202196203197 /*usb_control_msg seems to expect a kmalloced buffer */204204- unsigned char *bufs = kmalloc(len, GFP_KERNEL);198198+ unsigned char *bufs;199199+200200+ if (dev->state & DEV_DISCONNECTED)201201+ return(-ENODEV);202202+203203+ bufs = kmalloc(len, GFP_KERNEL);205204206205 em28xx_regdbg("req=%02x reg=%02x:", req, reg);207206···223212 ret = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), req,224213 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,225214 0x0000, reg, bufs, len, HZ);226226- mdelay(5); /* FIXME: magic number */215215+ msleep(5); /* FIXME: magic number */227216 kfree(bufs);228217 return ret;229218}···264253 if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)265254 return ret;266255 else if (((u8) ret) & 0x01) {267267- em28xx_warn ("AC97 command still being exectuted: not handled properly!\n");256256+ em28xx_warn ("AC97 command still being executed: not handled properly!\n");268257 }269258 return 0;270259}
+4-4
drivers/media/video/em28xx/em28xx-i2c.c
···7878 ret = dev->em28xx_read_reg(dev, 0x05);7979 if (ret == 0x80 + len - 1)8080 return len;8181- mdelay(5);8181+ msleep(5);8282 }8383 em28xx_warn("i2c write timed out\n");8484 return -EIO;···138138 return -ENODEV;139139 else if (msg == 0x84)140140 return 0;141141- mdelay(5);141141+ msleep(5);142142 }143143 return -ENODEV;144144}···278278 msgs[i].buf,279279 msgs[i].len,280280 i == num - 1);281281- if (rc < 0)282282- goto err;283281 }282282+ if (rc < 0)283283+ goto err;284284 if (i2c_debug>=2)285285 printk("\n");286286 }
+3
drivers/media/video/em28xx/em28xx-video.c
···66 Mauro Carvalho Chehab <mchehab@brturbo.com.br>77 Sascha Sommer <saschasommer@freenet.de>8899+ Some parts based on SN9C10x PC Camera Controllers GPL driver made1010+ by Luca Risolia <luca.risolia@studio.unibo.it>1111+912 This program is free software; you can redistribute it and/or modify1013 it under the terms of the GNU General Public License as published by1114 the Free Software Foundation; either version 2 of the License, or
···746746747747static inline void tvp5150_reset(struct i2c_client *c)748748{749749- u8 type, ver_656, msb_id, lsb_id, msb_rom, lsb_rom;749749+ u8 msb_id, lsb_id, msb_rom, lsb_rom;750750 struct tvp5150 *decoder = i2c_get_clientdata(c);751751752752- type=tvp5150_read(c,TVP5150_AUTOSW_MSK);753752 msb_id=tvp5150_read(c,TVP5150_MSB_DEV_ID);754753 lsb_id=tvp5150_read(c,TVP5150_LSB_DEV_ID);755754 msb_rom=tvp5150_read(c,TVP5150_ROM_MAJOR_VER);756755 lsb_rom=tvp5150_read(c,TVP5150_ROM_MINOR_VER);757756758758- if (type==0xdc) {759759- ver_656=tvp5150_read(c,TVP5150_REV_SELECT);760760- tvp5150_info("tvp%02x%02xam1 detected 656 version is %d.\n",msb_id, lsb_id,ver_656);761761- } else if (type==0xfc) {762762- tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id);757757+ if ((msb_rom==4)&&(lsb_rom==0)) { /* Is TVP5150AM1 */758758+ tvp5150_info("tvp%02x%02xam1 detected.\n",msb_id, lsb_id);759759+760760+ /* ITU-T BT.656.4 timing */761761+ tvp5150_write(c,TVP5150_REV_SELECT,0);763762 } else {764764- tvp5150_info("unknown tvp%02x%02x chip detected(%d).\n",msb_id,lsb_id,type);763763+ if ((msb_rom==3)||(lsb_rom==0x21)) { /* Is TVP5150A */764764+ tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id);765765+ } else {766766+ tvp5150_info("*** unknown tvp%02x%02x chip detected.\n",msb_id,lsb_id);767767+ tvp5150_info("*** Rom ver is %d.%d\n",msb_rom,lsb_rom);768768+ }765769 }766766- tvp5150_info("Rom ver is %d.%d\n",msb_rom,lsb_rom);767770768771 /* Initializes TVP5150 to its default values */769772 tvp5150_write_inittab(c, tvp5150_init_default);···896893 }897894 case DECODER_GET_STATUS:898895 {896896+ int *iarg = arg;897897+ int status;898898+ int res=0;899899+ status = tvp5150_read(c, 0x88);900900+ if(status&0x08){901901+ res |= DECODER_STATUS_COLOR;902902+ }903903+ if(status&0x04 && status&0x02){904904+ res |= DECODER_STATUS_GOOD;905905+ }906906+ *iarg=res;899907 break;900908 }901909
+1-6
drivers/net/Kconfig
···44#5566menu "Network device support"77+ depends on NET7889config NETDEVICES99- depends on NET1010 default y if UML1111 bool "Network device support"1212 ---help---···24242525 If unsure, say Y.26262727-# All the following symbols are dependent on NETDEVICES - do not repeat2828-# that for each of the symbols.2929-if NETDEVICES30273128config IFB3229 tristate "Intermediate Functional Block support"···27142717 ---help---27152718 If you want to log kernel messages over the network, enable this.27162719 See <file:Documentation/networking/netconsole.txt> for details.27172717-27182718-endif #NETDEVICES2719272027202721config NETPOLL27212722 def_bool NETCONSOLE
+1-1
drivers/net/tulip/uli526x.c
···214214/* For module input parameter */215215static int debug;216216static u32 cr6set;217217-static unsigned char mode = 8;217217+static int mode = 8;218218219219/* function declaration ------------------------------------- */220220static int uli526x_open(struct net_device *);
+45-39
include/asm-mips/bitops.h
···644644}645645646646/*647647- * flz - find last zero in word.648648- * @word: The word to search649649- *650650- * Returns 0..SZLONG-1651651- * Undefined if no zero exists, so code should check against ~0UL first.652652- */653653-static inline unsigned long flz(unsigned long word)654654-{655655-#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)656656- return __ilog2(~word);657657-#else658658-#ifdef CONFIG_32BIT659659- int r = 31, s;660660- word = ~word;661661- s = 16; if ((word & 0xffff0000)) s = 0; r -= s; word <<= s;662662- s = 8; if ((word & 0xff000000)) s = 0; r -= s; word <<= s;663663- s = 4; if ((word & 0xf0000000)) s = 0; r -= s; word <<= s;664664- s = 2; if ((word & 0xc0000000)) s = 0; r -= s; word <<= s;665665- s = 1; if ((word & 0x80000000)) s = 0; r -= s;666666-667667- return r;668668-#endif669669-#ifdef CONFIG_64BIT670670- int r = 63, s;671671- word = ~word;672672- s = 32; if ((word & 0xffffffff00000000UL)) s = 0; r -= s; word <<= s;673673- s = 16; if ((word & 0xffff000000000000UL)) s = 0; r -= s; word <<= s;674674- s = 8; if ((word & 0xff00000000000000UL)) s = 0; r -= s; word <<= s;675675- s = 4; if ((word & 0xf000000000000000UL)) s = 0; r -= s; word <<= s;676676- s = 2; if ((word & 0xc000000000000000UL)) s = 0; r -= s; word <<= s;677677- s = 1; if ((word & 0x8000000000000000UL)) s = 0; r -= s;678678-679679- return r;680680-#endif681681-#endif682682-}683683-684684-/*685647 * fls - find last bit set.686648 * @word: The word to search687649 *···652690 */653691static inline unsigned long fls(unsigned long word)654692{693693+#ifdef CONFIG_32BIT694694+#ifdef CONFIG_CPU_MIPS32695695+ __asm__ ("clz %0, %1" : "=r" (word) : "r" (word));696696+697697+ return 32 - word;698698+#else699699+ {700700+ int r = 32, s;701701+655702 if (word == 0)656703 return 0;657704658658- return flz(~word) + 1;705705+ s = 16; if ((word & 0xffff0000)) s = 0; r -= s; word <<= s;706706+ s = 8; if ((word & 0xff000000)) s = 0; r -= s; word <<= s;707707+ s = 4; if ((word & 0xf0000000)) s = 0; r -= s; word <<= s;708708+ s = 2; if ((word & 0xc0000000)) s = 0; r -= s; word <<= s;709709+ s = 1; if ((word & 0x80000000)) s = 0; r -= s;710710+711711+ return r;712712+ }713713+#endif714714+#endif /* CONFIG_32BIT */715715+716716+#ifdef CONFIG_64BIT717717+#ifdef CONFIG_CPU_MIPS64718718+719719+ __asm__ ("dclz %0, %1" : "=r" (word) : "r" (word));720720+721721+ return 64 - word;722722+#else723723+ {724724+ int r = 64, s;725725+726726+ if (word == 0)727727+ return 0;728728+729729+ s = 32; if ((word & 0xffffffff00000000UL)) s = 0; r -= s; word <<= s;730730+ s = 16; if ((word & 0xffff000000000000UL)) s = 0; r -= s; word <<= s;731731+ s = 8; if ((word & 0xff00000000000000UL)) s = 0; r -= s; word <<= s;732732+ s = 4; if ((word & 0xf000000000000000UL)) s = 0; r -= s; word <<= s;733733+ s = 2; if ((word & 0xc000000000000000UL)) s = 0; r -= s; word <<= s;734734+ s = 1; if ((word & 0x8000000000000000UL)) s = 0; r -= s;735735+736736+ return r;737737+ }738738+#endif739739+#endif /* CONFIG_64BIT */659740}741741+660742#define fls64(x) generic_fls64(x)661743662744/*
···1818 * so, for 64bit IP32 kernel we just don't use ll/sc.1919 * This does not affect luserland.2020 */2121-#if defined(CONFIG_CPU_R5000) && defined(CONFIG_64BIT)2121+#if (defined(CONFIG_CPU_R5000) || defined(CONFIG_CPU_NEVADA)) && defined(CONFIG_64BIT)2222#define cpu_has_llsc 02323#else2424#define cpu_has_llsc 1
+48-348
include/asm-mips/r4kcache.h
···166166 : "r" (base), \167167 "i" (op));168168169169-static inline void blast_dcache16(void)170170-{171171- unsigned long start = INDEX_BASE;172172- unsigned long end = start + current_cpu_data.dcache.waysize;173173- unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;174174- unsigned long ws_end = current_cpu_data.dcache.ways <<175175- current_cpu_data.dcache.waybit;176176- unsigned long ws, addr;177177-178178- for (ws = 0; ws < ws_end; ws += ws_inc)179179- for (addr = start; addr < end; addr += 0x200)180180- cache16_unroll32(addr|ws,Index_Writeback_Inv_D);181181-}182182-183183-static inline void blast_dcache16_page(unsigned long page)184184-{185185- unsigned long start = page;186186- unsigned long end = start + PAGE_SIZE;187187-188188- do {189189- cache16_unroll32(start,Hit_Writeback_Inv_D);190190- start += 0x200;191191- } while (start < end);192192-}193193-194194-static inline void blast_dcache16_page_indexed(unsigned long page)195195-{196196- unsigned long start = page;197197- unsigned long end = start + PAGE_SIZE;198198- unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;199199- unsigned long ws_end = current_cpu_data.dcache.ways <<200200- current_cpu_data.dcache.waybit;201201- unsigned long ws, addr;202202-203203- for (ws = 0; ws < ws_end; ws += ws_inc)204204- for (addr = start; addr < end; addr += 0x200)205205- cache16_unroll32(addr|ws,Index_Writeback_Inv_D);206206-}207207-208208-static inline void blast_icache16(void)209209-{210210- unsigned long start = INDEX_BASE;211211- unsigned long end = start + current_cpu_data.icache.waysize;212212- unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;213213- unsigned long ws_end = current_cpu_data.icache.ways <<214214- current_cpu_data.icache.waybit;215215- unsigned long ws, addr;216216-217217- for (ws = 0; ws < ws_end; ws += ws_inc)218218- for (addr = start; addr < end; addr += 0x200)219219- cache16_unroll32(addr|ws,Index_Invalidate_I);220220-}221221-222222-static inline void blast_icache16_page(unsigned long page)223223-{224224- unsigned long start = page;225225- unsigned long end = start + PAGE_SIZE;226226-227227- do {228228- cache16_unroll32(start,Hit_Invalidate_I);229229- start += 0x200;230230- } while (start < end);231231-}232232-233233-static inline void blast_icache16_page_indexed(unsigned long page)234234-{235235- unsigned long start = page;236236- unsigned long end = start + PAGE_SIZE;237237- unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;238238- unsigned long ws_end = current_cpu_data.icache.ways <<239239- current_cpu_data.icache.waybit;240240- unsigned long ws, addr;241241-242242- for (ws = 0; ws < ws_end; ws += ws_inc)243243- for (addr = start; addr < end; addr += 0x200)244244- cache16_unroll32(addr|ws,Index_Invalidate_I);245245-}246246-247247-static inline void blast_scache16(void)248248-{249249- unsigned long start = INDEX_BASE;250250- unsigned long end = start + current_cpu_data.scache.waysize;251251- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;252252- unsigned long ws_end = current_cpu_data.scache.ways <<253253- current_cpu_data.scache.waybit;254254- unsigned long ws, addr;255255-256256- for (ws = 0; ws < ws_end; ws += ws_inc)257257- for (addr = start; addr < end; addr += 0x200)258258- cache16_unroll32(addr|ws,Index_Writeback_Inv_SD);259259-}260260-261261-static inline void blast_scache16_page(unsigned long page)262262-{263263- unsigned long start = page;264264- unsigned long end = page + PAGE_SIZE;265265-266266- do {267267- cache16_unroll32(start,Hit_Writeback_Inv_SD);268268- start += 0x200;269269- } while (start < end);270270-}271271-272272-static inline void blast_scache16_page_indexed(unsigned long page)273273-{274274- unsigned long start = page;275275- unsigned long end = start + PAGE_SIZE;276276- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;277277- unsigned long ws_end = current_cpu_data.scache.ways <<278278- current_cpu_data.scache.waybit;279279- unsigned long ws, addr;280280-281281- for (ws = 0; ws < ws_end; ws += ws_inc)282282- for (addr = start; addr < end; addr += 0x200)283283- cache16_unroll32(addr|ws,Index_Writeback_Inv_SD);284284-}285285-286169#define cache32_unroll32(base,op) \287170 __asm__ __volatile__( \288171 " .set push \n" \···191308 : \192309 : "r" (base), \193310 "i" (op));194194-195195-static inline void blast_dcache32(void)196196-{197197- unsigned long start = INDEX_BASE;198198- unsigned long end = start + current_cpu_data.dcache.waysize;199199- unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;200200- unsigned long ws_end = current_cpu_data.dcache.ways <<201201- current_cpu_data.dcache.waybit;202202- unsigned long ws, addr;203203-204204- for (ws = 0; ws < ws_end; ws += ws_inc)205205- for (addr = start; addr < end; addr += 0x400)206206- cache32_unroll32(addr|ws,Index_Writeback_Inv_D);207207-}208208-209209-static inline void blast_dcache32_page(unsigned long page)210210-{211211- unsigned long start = page;212212- unsigned long end = start + PAGE_SIZE;213213-214214- do {215215- cache32_unroll32(start,Hit_Writeback_Inv_D);216216- start += 0x400;217217- } while (start < end);218218-}219219-220220-static inline void blast_dcache32_page_indexed(unsigned long page)221221-{222222- unsigned long start = page;223223- unsigned long end = start + PAGE_SIZE;224224- unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;225225- unsigned long ws_end = current_cpu_data.dcache.ways <<226226- current_cpu_data.dcache.waybit;227227- unsigned long ws, addr;228228-229229- for (ws = 0; ws < ws_end; ws += ws_inc)230230- for (addr = start; addr < end; addr += 0x400)231231- cache32_unroll32(addr|ws,Index_Writeback_Inv_D);232232-}233233-234234-static inline void blast_icache32(void)235235-{236236- unsigned long start = INDEX_BASE;237237- unsigned long end = start + current_cpu_data.icache.waysize;238238- unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;239239- unsigned long ws_end = current_cpu_data.icache.ways <<240240- current_cpu_data.icache.waybit;241241- unsigned long ws, addr;242242-243243- for (ws = 0; ws < ws_end; ws += ws_inc)244244- for (addr = start; addr < end; addr += 0x400)245245- cache32_unroll32(addr|ws,Index_Invalidate_I);246246-}247247-248248-static inline void blast_icache32_page(unsigned long page)249249-{250250- unsigned long start = page;251251- unsigned long end = start + PAGE_SIZE;252252-253253- do {254254- cache32_unroll32(start,Hit_Invalidate_I);255255- start += 0x400;256256- } while (start < end);257257-}258258-259259-static inline void blast_icache32_page_indexed(unsigned long page)260260-{261261- unsigned long start = page;262262- unsigned long end = start + PAGE_SIZE;263263- unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;264264- unsigned long ws_end = current_cpu_data.icache.ways <<265265- current_cpu_data.icache.waybit;266266- unsigned long ws, addr;267267-268268- for (ws = 0; ws < ws_end; ws += ws_inc)269269- for (addr = start; addr < end; addr += 0x400)270270- cache32_unroll32(addr|ws,Index_Invalidate_I);271271-}272272-273273-static inline void blast_scache32(void)274274-{275275- unsigned long start = INDEX_BASE;276276- unsigned long end = start + current_cpu_data.scache.waysize;277277- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;278278- unsigned long ws_end = current_cpu_data.scache.ways <<279279- current_cpu_data.scache.waybit;280280- unsigned long ws, addr;281281-282282- for (ws = 0; ws < ws_end; ws += ws_inc)283283- for (addr = start; addr < end; addr += 0x400)284284- cache32_unroll32(addr|ws,Index_Writeback_Inv_SD);285285-}286286-287287-static inline void blast_scache32_page(unsigned long page)288288-{289289- unsigned long start = page;290290- unsigned long end = page + PAGE_SIZE;291291-292292- do {293293- cache32_unroll32(start,Hit_Writeback_Inv_SD);294294- start += 0x400;295295- } while (start < end);296296-}297297-298298-static inline void blast_scache32_page_indexed(unsigned long page)299299-{300300- unsigned long start = page;301301- unsigned long end = start + PAGE_SIZE;302302- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;303303- unsigned long ws_end = current_cpu_data.scache.ways <<304304- current_cpu_data.scache.waybit;305305- unsigned long ws, addr;306306-307307- for (ws = 0; ws < ws_end; ws += ws_inc)308308- for (addr = start; addr < end; addr += 0x400)309309- cache32_unroll32(addr|ws,Index_Writeback_Inv_SD);310310-}311311312312#define cache64_unroll32(base,op) \313313 __asm__ __volatile__( \···218452 : "r" (base), \219453 "i" (op));220454221221-static inline void blast_icache64(void)222222-{223223- unsigned long start = INDEX_BASE;224224- unsigned long end = start + current_cpu_data.icache.waysize;225225- unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;226226- unsigned long ws_end = current_cpu_data.icache.ways <<227227- current_cpu_data.icache.waybit;228228- unsigned long ws, addr;229229-230230- for (ws = 0; ws < ws_end; ws += ws_inc)231231- for (addr = start; addr < end; addr += 0x800)232232- cache64_unroll32(addr|ws,Index_Invalidate_I);233233-}234234-235235-static inline void blast_icache64_page(unsigned long page)236236-{237237- unsigned long start = page;238238- unsigned long end = start + PAGE_SIZE;239239-240240- do {241241- cache64_unroll32(start,Hit_Invalidate_I);242242- start += 0x800;243243- } while (start < end);244244-}245245-246246-static inline void blast_icache64_page_indexed(unsigned long page)247247-{248248- unsigned long start = page;249249- unsigned long end = start + PAGE_SIZE;250250- unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;251251- unsigned long ws_end = current_cpu_data.icache.ways <<252252- current_cpu_data.icache.waybit;253253- unsigned long ws, addr;254254-255255- for (ws = 0; ws < ws_end; ws += ws_inc)256256- for (addr = start; addr < end; addr += 0x800)257257- cache64_unroll32(addr|ws,Index_Invalidate_I);258258-}259259-260260-static inline void blast_scache64(void)261261-{262262- unsigned long start = INDEX_BASE;263263- unsigned long end = start + current_cpu_data.scache.waysize;264264- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;265265- unsigned long ws_end = current_cpu_data.scache.ways <<266266- current_cpu_data.scache.waybit;267267- unsigned long ws, addr;268268-269269- for (ws = 0; ws < ws_end; ws += ws_inc)270270- for (addr = start; addr < end; addr += 0x800)271271- cache64_unroll32(addr|ws,Index_Writeback_Inv_SD);272272-}273273-274274-static inline void blast_scache64_page(unsigned long page)275275-{276276- unsigned long start = page;277277- unsigned long end = page + PAGE_SIZE;278278-279279- do {280280- cache64_unroll32(start,Hit_Writeback_Inv_SD);281281- start += 0x800;282282- } while (start < end);283283-}284284-285285-static inline void blast_scache64_page_indexed(unsigned long page)286286-{287287- unsigned long start = page;288288- unsigned long end = start + PAGE_SIZE;289289- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;290290- unsigned long ws_end = current_cpu_data.scache.ways <<291291- current_cpu_data.scache.waybit;292292- unsigned long ws, addr;293293-294294- for (ws = 0; ws < ws_end; ws += ws_inc)295295- for (addr = start; addr < end; addr += 0x800)296296- cache64_unroll32(addr|ws,Index_Writeback_Inv_SD);297297-}298298-299455#define cache128_unroll32(base,op) \300456 __asm__ __volatile__( \301457 " .set push \n" \···244556 : "r" (base), \245557 "i" (op));246558247247-static inline void blast_scache128(void)248248-{249249- unsigned long start = INDEX_BASE;250250- unsigned long end = start + current_cpu_data.scache.waysize;251251- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;252252- unsigned long ws_end = current_cpu_data.scache.ways <<253253- current_cpu_data.scache.waybit;254254- unsigned long ws, addr;255255-256256- for (ws = 0; ws < ws_end; ws += ws_inc)257257- for (addr = start; addr < end; addr += 0x1000)258258- cache128_unroll32(addr|ws,Index_Writeback_Inv_SD);559559+/* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */560560+#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize) \561561+static inline void blast_##pfx##cache##lsize(void) \562562+{ \563563+ unsigned long start = INDEX_BASE; \564564+ unsigned long end = start + current_cpu_data.desc.waysize; \565565+ unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit; \566566+ unsigned long ws_end = current_cpu_data.desc.ways << \567567+ current_cpu_data.desc.waybit; \568568+ unsigned long ws, addr; \569569+ \570570+ for (ws = 0; ws < ws_end; ws += ws_inc) \571571+ for (addr = start; addr < end; addr += lsize * 32) \572572+ cache##lsize##_unroll32(addr|ws,indexop); \573573+} \574574+ \575575+static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \576576+{ \577577+ unsigned long start = page; \578578+ unsigned long end = page + PAGE_SIZE; \579579+ \580580+ do { \581581+ cache##lsize##_unroll32(start,hitop); \582582+ start += lsize * 32; \583583+ } while (start < end); \584584+} \585585+ \586586+static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \587587+{ \588588+ unsigned long start = page; \589589+ unsigned long end = start + PAGE_SIZE; \590590+ unsigned long ws_inc = 1UL << current_cpu_data.desc.waybit; \591591+ unsigned long ws_end = current_cpu_data.desc.ways << \592592+ current_cpu_data.desc.waybit; \593593+ unsigned long ws, addr; \594594+ \595595+ for (ws = 0; ws < ws_end; ws += ws_inc) \596596+ for (addr = start; addr < end; addr += lsize * 32) \597597+ cache##lsize##_unroll32(addr|ws,indexop); \259598}260599261261-static inline void blast_scache128_page(unsigned long page)262262-{263263- unsigned long start = page;264264- unsigned long end = page + PAGE_SIZE;265265-266266- do {267267- cache128_unroll32(start,Hit_Writeback_Inv_SD);268268- start += 0x1000;269269- } while (start < end);270270-}271271-272272-static inline void blast_scache128_page_indexed(unsigned long page)273273-{274274- unsigned long start = page;275275- unsigned long end = start + PAGE_SIZE;276276- unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;277277- unsigned long ws_end = current_cpu_data.scache.ways <<278278- current_cpu_data.scache.waybit;279279- unsigned long ws, addr;280280-281281- for (ws = 0; ws < ws_end; ws += ws_inc)282282- for (addr = start; addr < end; addr += 0x1000)283283- cache128_unroll32(addr|ws,Index_Writeback_Inv_SD);284284-}600600+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16)601601+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16)602602+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16)603603+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32)604604+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32)605605+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32)606606+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)607607+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64)608608+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128)285609286610#endif /* _ASM_R4KCACHE_H */
+1-2
include/asm-mips/reboot.h
···33 * License. See the file "COPYING" in the main directory of this archive44 * for more details.55 *66- * Copyright (C) 1997, 1999, 2001 by Ralf Baechle66+ * Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle77 * Copyright (C) 2001 MIPS Technologies, Inc.88 */99#ifndef _ASM_REBOOT_H···11111212extern void (*_machine_restart)(char *command);1313extern void (*_machine_halt)(void);1414-extern void (*_machine_power_off)(void);15141615#endif /* _ASM_REBOOT_H */
···22 * Author: MontaVista Software, Inc.33 * source@mvista.com44 *55- * Copyright 2001-2002 MontaVista Software Inc.55+ * Copyright 2001-2006 MontaVista Software Inc.66 *77 * This program is free software; you can redistribute it and/or modify it88 * under the terms of the GNU General Public License as published by the···3030#include <asm/tx4927/tx4927_mips.h>31313232/*3333- This register naming came from the intergrate cpu/controoler name TX49273333+ This register naming came from the integrated CPU/controller name TX49273434 followed by the device name from table 4.2.2 on page 4-3 and then followed3535 by the register name from table 4.2.3 on pages 4-4 to 4-8. The manaul3636- used is "TMPR4927BT Preliminary Rev 0.1 20.Jul.2001".3636+ used was "TMPR4927BT Preliminary Rev 0.1 20.Jul.2001".3737 */38383939#define TX4927_SIO_0_BASE···251251252252/* TX4927 Timer 0 (32-bit registers) */253253#define TX4927_TMR0_BASE 0xf000254254-#define TX4927_TMR0_TMTCR0 0xf004255255-#define TX4927_TMR0_TMTISR0 0xf008254254+#define TX4927_TMR0_TMTCR0 0xf000255255+#define TX4927_TMR0_TMTISR0 0xf004256256#define TX4927_TMR0_TMCPRA0 0xf008257257#define TX4927_TMR0_TMCPRB0 0xf00c258258#define TX4927_TMR0_TMITMR0 0xf010···264264265265/* TX4927 Timer 1 (32-bit registers) */266266#define TX4927_TMR1_BASE 0xf100267267-#define TX4927_TMR1_TMTCR1 0xf104268268-#define TX4927_TMR1_TMTISR1 0xf108267267+#define TX4927_TMR1_TMTCR1 0xf100268268+#define TX4927_TMR1_TMTISR1 0xf104269269#define TX4927_TMR1_TMCPRA1 0xf108270270#define TX4927_TMR1_TMCPRB1 0xf10c271271#define TX4927_TMR1_TMITMR1 0xf110···277277278278/* TX4927 Timer 2 (32-bit registers) */279279#define TX4927_TMR2_BASE 0xf200280280-#define TX4927_TMR2_TMTCR2 0xf104281281-#define TX4927_TMR2_TMTISR2 0xf208280280+#define TX4927_TMR2_TMTCR2 0xf200281281+#define TX4927_TMR2_TMTISR2 0xf204282282#define TX4927_TMR2_TMCPRA2 0xf208283283-#define TX4927_TMR2_TMCPRB2 0xf20c284283#define TX4927_TMR2_TMITMR2 0xf210285284#define TX4927_TMR2_TMCCDR2 0xf220286286-#define TX4927_TMR2_TMPGMR2 0xf230285285+#define TX4927_TMR2_TMWTMR2 0xf240287286#define TX4927_TMR2_TMTRR2 0xf2f0288287#define TX4927_TMR2_LIMIT 0xf2ff289288
···22#3344check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh55-HOST_EXTRACFLAGS:= $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)66-HOST_LOADLIBES := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))55+66+# Use reursively expanded variables so we do not call gcc unless77+# we really need to do so. (Do not call gcc as part of make mrproper)88+HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)99+HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))710811HOST_EXTRACFLAGS += -DLOCALE 912
+9-5
scripts/kconfig/lxdialog/check-lxdialog.sh
···44# What library to link55ldflags()66{77- echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null77+ $cc -print-file-name=libncursesw.so | grep -q /88 if [ $? -eq 0 ]; then99 echo '-lncursesw'1010 exit1111 fi1212- echo "main() {}" | $cc -lncurses -xc - -o /dev/null 2> /dev/null1212+ $cc -print-file-name=libncurses.so | grep -q /1313 if [ $? -eq 0 ]; then1414 echo '-lncurses'1515 exit1616 fi1717- echo "main() {}" | $cc -lcurses -xc - -o /dev/null 2> /dev/null1717+ $cc -print-file-name=libcurses.so | grep -q /1818 if [ $? -eq 0 ]; then1919 echo '-lcurses'2020 exit···3636 fi3737}38383939-compiler=""3939+# Temp file, try to clean up after us4040+tmp=.lxdialog.tmp4141+trap "rm -f $tmp" 0 1 2 3 154242+4043# Check if we can link to ncurses4144check() {4242- echo "main() {}" | $cc -xc - -o /dev/null 2> /dev/null4545+ echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null4346 if [ $? != 0 ]; then4447 echo " *** Unable to find the ncurses libraries." 1>&24548 echo " *** make menuconfig require the ncurses libraries" 1>&2···6259 exit 16360fi64616262+cc=""6563case "$1" in6664 "-check")6765 shift