| # Copyright 2020 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # New USB camera detected. |
| ACTION=="add", SUBSYSTEM=="video4linux", ENV{ID_USB_DRIVER}=="uvcvideo", \ |
| RUN+="/bin/sh -c '/sbin/status system-services | /bin/grep -q \"start/running\" && /sbin/initctl emit --no-wait camera-device-added || true'" |
| |
| # New MIPI camera sensor detected. |
| ACTION=="add", SUBSYSTEM=="video4linux", SUBSYSTEMS=="i2c", \ |
| RUN+="/bin/sh -c '/sbin/status system-services | /bin/grep -q \"start/running\" && /sbin/initctl emit --no-wait camera-device-added || true'" |
| |
| # Limit access to camx video nodes to the camera HAL. |
| ATTR{name}=="cam_sync", SUBSYSTEM=="video4linux", GROUP="camera" |
| ATTR{name}=="cam-req-mgr", SUBSYSTEM=="video4linux", GROUP="camera" |
| |
| # Limit access to MTK's mdp3 video node to the camera HAL. |
| ATTR{name}=="mtk-mdp3:m2m", SUBSYSTEM=="video4linux", GROUP="camera" |
| |
| # Limit access to capture device nodes (cameras) to the camera HAL. |
| ENV{ID_V4L_CAPABILITIES}==":capture:", SUBSYSTEM=="video4linux", GROUP="camera" |
| |
| # Limit access to v4l subdevices to the camera HAL. |
| SUBSYSTEM=="video4linux", KERNEL=="v4l-subdev*", GROUP="camera" |
| |
| # Limit access to media devices to the camera HAL. |
| SUBSYSTEM=="media", ENV{MEDIA_DEVICE_TYPE}!="decoder", GROUP="camera" |
| |
| # Limit access to /dev/dma_heap to the camera HAL. This will allow us to do |
| # dma-heap buffer allocation. |
| SUBSYSTEM=="dma_heap", ENV{DEVNAME}=="/dev/dma_heap/*", GROUP="camera" |
| |
| # Limit access to /dev/mtk_hcp to the camera HAL for mtkisp7 (geralt). |
| # This should be removed once MTK migrate it to SCP. |
| SUBSYSTEM=="mtk_hcp_driver", ENV{DEVNAME}=="/dev/mtk_hcp", GROUP="camera" |
| |
| # Limit access to /dev/apusys to the camera HAL for mtkisp7 (geralt). |
| SUBSYSTEM=="misc", ENV{DEVNAME}=="/dev/apusys", GROUP="camera" |