// SPDX-License-Identifier: GPL-2.0-or-later /* * Zoran ZR36016 basic configuration functions * * Copyright (C) 2001 Wolfgang Scherr <[email protected]> */ #include <linux/module.h> #include <linux/init.h> #include <linux/slab.h> /* headerfile of this module */ #include "zr36016.h" /* codec io API */ #include "videocodec.h" /* * it doesn't make sense to have more than 20 or so, * just to prevent some unwanted loops */ #define MAX_CODECS … /* amount of chips attached via this driver */ static int zr36016_codecs; /* * Local hardware I/O functions: read/write via codec layer * (registers are located in the master device) */ /* read and write functions */ static u8 zr36016_read(struct zr36016 *ptr, u16 reg) { … } static void zr36016_write(struct zr36016 *ptr, u16 reg, u8 value) { … } /* * indirect read and write functions * * the 016 supports auto-addr-increment, but * writing it all time cost not much and is safer... */ static u8 zr36016_readi(struct zr36016 *ptr, u16 reg) { … } static void zr36016_writei(struct zr36016 *ptr, u16 reg, u8 value) { … } /* Local helper function: version read */ /* version kept in datastructure */ static u8 zr36016_read_version(struct zr36016 *ptr) { … } /* * Local helper function: basic test of "connectivity", writes/reads * to/from PAX-Lo register */ static int zr36016_basic_test(struct zr36016 *ptr) { … } /* Basic datasets & init */ static void zr36016_init(struct zr36016 *ptr) { … } /* * CODEC API FUNCTIONS * * These functions are accessed by the master via the API structure */ /* * set compression/expansion mode and launches codec - * this should be the last call from the master before starting processing */ static int zr36016_set_mode(struct videocodec *codec, int mode) { … } /* set picture size */ static int zr36016_set_video(struct videocodec *codec, const struct tvnorm *norm, struct vfe_settings *cap, struct vfe_polarity *pol) { … } /* additional control functions */ static int zr36016_control(struct videocodec *codec, int type, int size, void *data) { … } /* * Exit and unregister function: * * Deinitializes Zoran's JPEG processor */ static int zr36016_unset(struct videocodec *codec) { … } /* * Setup and registry function: * * Initializes Zoran's JPEG processor * * Also sets pixel size, average code size, mode (compr./decompr.) * (the given size is determined by the processor with the video interface) */ static int zr36016_setup(struct videocodec *codec) { … } static const struct videocodec zr36016_codec = …; /* HOOK IN DRIVER AS KERNEL MODULE */ int zr36016_init_module(void) { … } void zr36016_cleanup_module(void) { … }